diff --git a/src/plots/plots.js b/src/plots/plots.js index 6f4dfcf913e..7b10320ac2d 100644 --- a/src/plots/plots.js +++ b/src/plots/plots.js @@ -257,6 +257,9 @@ plots.previousPromises = function(gd) { * Add source links to your graph inside the 'showSources' config argument. */ plots.addLinks = function(gd) { + // Do not do anything if showLink and showSources are not set to true in config + if(!gd._context.showLink && !gd._context.showSources) return; + var fullLayout = gd._fullLayout; var linkContainer = fullLayout._paper diff --git a/test/jasmine/tests/config_test.js b/test/jasmine/tests/config_test.js index 9181e56d4e5..5ff20cfda94 100644 --- a/test/jasmine/tests/config_test.js +++ b/test/jasmine/tests/config_test.js @@ -160,11 +160,7 @@ describe('config argument', function() { var link = document.getElementsByClassName('js-plot-link-container')[0]; - expect(link.textContent).toBe(''); - - var bBox = link.getBoundingClientRect(); - expect(bBox.width).toBe(0); - expect(bBox.height).toBe(0); + expect(link).toBeUndefined(); }); it('should display a link when true', function() {