Skip to content

Commit

Permalink
early return from sendDataToCloud when using blank plotlyServerURL de…
Browse files Browse the repository at this point in the history
…fault
  • Loading branch information
archmoj committed Mar 26, 2020
1 parent 514aef4 commit f661184
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/plot_api/plot_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ var configAttributes = {
valType: 'string',
dflt: '',
description: [
'Sets base URL for the \'Edit in Chart Studio\' (aka sendDataToCloud) mode bar button',
'and the showLink/sendData on-graph link'
'When set it determines base URL for',
'the \'Edit in Chart Studio\' (aka sendDataToCloud) mode bar button',
'and the showLink/sendData on-graph link.'
].join(' ')
},

Expand Down
5 changes: 3 additions & 2 deletions src/plots/plots.js
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,10 @@ function positionPlayWithData(gd, container) {
}

plots.sendDataToCloud = function(gd) {
gd.emit('plotly_beforeexport');

var baseUrl = (window.PLOTLYENV || {}).BASE_URL || gd._context.plotlyServerURL;
if(!baseUrl) return;

gd.emit('plotly_beforeexport');

var hiddenformDiv = d3.select(gd)
.append('div')
Expand Down
3 changes: 1 addition & 2 deletions test/jasmine/tests/config_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,7 @@ describe('config argument', function() {
expect(gd._context.plotlyServerURL).toBe('');

Plotly.Plots.sendDataToCloud(gd);
expect(form.action.substring(0, 17)).toBe('http://localhost:');
expect(form.method).toBe('post');
expect(form).toBe(undefined);
})
.catch(failTest)
.then(done);
Expand Down

0 comments on commit f661184

Please sign in to comment.