8000 Introduce global contexts by dy · Pull Request #2159 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Fix noCI tests
  • Loading branch information
dy committed Nov 27, 2017
commit de9b1aa21cbf72d0022dae427ea93b8dbd2f32fe
6 changes: 6 additions & 0 deletions src/plot_api/plot_api.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ Plotly.plot = function(gd, data, layout, config) {
})
.attr('width', fullLayout.width)
.attr('height', fullLayout.height);

fullLayout._glcanvas.filter(function(d) {
return !d.pick;
}).style({
'pointer-events': 'none'
});
}

return Lib.syncOrAsync([
Expand Down
1 change: 0 additions & 1 deletion src/plots/cartesian/select.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ module.exports = function prepSelect(e, startX, startY, dragOptions, mode) {

throttle.done(throttleID).then(function() {
throttle.clear(throttleID);

if(!dragged && numclicks === 2) {
// clear selection on doubleclick
outlines.remove();
Expand Down
5 changes: 5 additions & 0 deletions src/plots/gl2d/scene2d.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,9 @@ proto.makeFramework = function() {
mouseContainer.style.position = 'absolute';
mouseContainer.style['pointer-events'] = 'auto';

this.pickCanvas = this.container.querySelector('.gl-canvas-pick');


// append canvas, hover svg and mouse div to container
var container = this.container;
container.appendChild(svgContainer);
Expand Down Expand Up @@ -531,8 +534,10 @@ proto.updateTraces = function(fullData, calcData) {
proto.updateFx = function(dragmode) {
// switch to svg interactions in lasso/select mode
if(dragmode === 'lasso' || dragmode === 'select') {
this.pickCanvas.style['pointer-events'] = 'none';
this.mouseContainer.style['pointer-events'] = 'none';
} else {
this.pickCanvas.style['pointer-events'] = 'auto';
this.mouseContainer.style['pointer-events'] = 'auto';
}

Expand Down
2 changes: 1 addition & 1 deletion test/jasmine/tests/gl2d_click_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ describe('@noCI Test gl2d lasso/select:', function() {
function select(path) {
return new Promise(function(resolve, reject) {
gd.once('plotly_selected', resolve);
setTimeout(function() { reject('did not trigger *plotly_selected*');}, 100);
setTimeout(function() { reject('did not trigger *plotly_selected*');}, 200);
drag(path);
});
}
Expand Down
0