Skip to content

Commit f661184

Browse files
committed
early return from sendDataToCloud when using blank plotlyServerURL default
1 parent 514aef4 commit f661184

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

src/plot_api/plot_config.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ var configAttributes = {
3434
valType: 'string',
3535
dflt: '',
3636
description: [
37-
'Sets base URL for the \'Edit in Chart Studio\' (aka sendDataToCloud) mode bar button',
38-
'and the showLink/sendData on-graph link'
37+
'When set it determines base URL for',
38+
'the \'Edit in Chart Studio\' (aka sendDataToCloud) mode bar button',
39+
'and the showLink/sendData on-graph link.'
3940
].join(' ')
4041
},
4142

src/plots/plots.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,10 @@ function positionPlayWithData(gd, container) {
215215
}
216216

217217
plots.sendDataToCloud = function(gd) {
218-
gd.emit('plotly_beforeexport');
219-
220218
var baseUrl = (window.PLOTLYENV || {}).BASE_URL || gd._context.plotlyServerURL;
219+
if(!baseUrl) return;
220+
221+
gd.emit('plotly_beforeexport');
221222

222223
var hiddenformDiv = d3.select(gd)
223224
.append('div')

test/jasmine/tests/config_test.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -509,8 +509,7 @@ describe('config argument', function() {
509509
expect(gd._context.plotlyServerURL).toBe('');
510510

511511
Plotly.Plots.sendDataToCloud(gd);
512-
expect(form.action.substring(0, 17)).toBe('http://localhost:');
513-
expect(form.method).toBe('post');
512+
expect(form).toBe(undefined);
514513
})
515514
.catch(failTest)
516515
.then(done);

0 commit comments

Comments
 (0)