Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/plots/plots.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 1 addition & 5 deletions test/jasmine/tests/config_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down