Skip to content

Commit a376817

Browse files
committedJun 30, 2017
clear all selection outlines in one place
- during supplyDefaults
1 parent e3aa07d commit a376817

File tree

4 files changed

+7
-16
lines changed

4 files changed

+7
-16
lines changed
 

‎src/plots/cartesian/index.js

-5
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,6 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout)
184184
oldFullLayout._infolayer.select('.' + axIds[i] + 'title').remove();
185185
}
186186
}
187-
188-
// clean selection
189-
if(oldFullLayout._zoomlayer) {
190-
oldFullLayout._zoomlayer.selectAll('.select-outline').remove();
191-
}
192187
};
193188

194189
exports.drawFramework = function(gd) {

‎src/plots/mapbox/mapbox.js

+3-7
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,6 @@ proto.updateFx = function(fullLayout) {
328328

329329
if(self.isStatic) return;
330330

331-
function clearSelect() {
332-
fullLayout._zoomlayer.selectAll('.select-outline').remove();
333-
}
334-
335331
function invert(pxpy) {
336332
var obj = self.map.unproject(pxpy);
337333
return [obj.lng, obj.lat];
@@ -376,16 +372,16 @@ proto.updateFx = function(fullLayout) {
376372
};
377373

378374
dragOptions.doneFn = function(dragged, numClicks) {
379-
if(numClicks === 2) clearSelect();
375+
if(numClicks === 2) {
376+
fullLayout._zoomlayer.selectAll('.select-outline').remove();
377+
}
380378
};
381379

382380
dragElement.init(dragOptions);
383381
} else {
384382
map.dragPan.enable();
385383
self.div.onmousedown = null;
386384
}
387-
388-
clearSelect();
389385
};
390386

391387
proto.updateFramework = function(fullLayout) {

‎src/plots/plots.js

+4
Original file line numberDiff line numberDiff line change
@@ -624,6 +624,10 @@ plots.cleanPlot = function(newFullData, newFullLayout, oldFullData, oldFullLayou
624624
.selectAll(query).remove();
625625
}
626626
}
627+
628+
if(oldFullLayout._zoomlayer) {
629+
oldFullLayout._zoomlayer.selectAll('.select-outline').remove();
630+
}
627631
};
628632

629633
plots.linkSubplots = function(newFullData, newFullLayout, oldFullData, oldFullLayout) {

‎src/plots/ternary/index.js

-4
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,4 @@ exports.clean = function(newFullData, newFullLayout, oldFullData, oldFullLayout)
6969
oldTernary.clipDef.remove();
7070
}
7171
}
72-
73-
if(oldFullLayout._zoomlayer) {
74-
oldFullLayout._zoomlayer.selectAll('.select-outline').remove();
75-
}
7672
};

0 commit comments

Comments
 (0)
Please sign in to comment.