mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 23:44:47 +02:00
Cancel throttled hover events when exiting hover modes
possibly related to #2736, as a source of "Uncaught Error Entity xxxx not found" errors
This commit is contained in:
@@ -116,6 +116,7 @@ iD.behavior.Draw = function(context) {
|
||||
}
|
||||
|
||||
draw.off = function(selection) {
|
||||
context.ui().sidebar.hover.cancel();
|
||||
context.uninstall(hover);
|
||||
context.uninstall(edit);
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ iD.modes.Browse = function(context) {
|
||||
};
|
||||
|
||||
mode.exit = function() {
|
||||
context.ui().sidebar.hover.cancel();
|
||||
behaviors.forEach(function(behavior) {
|
||||
context.uninstall(behavior);
|
||||
});
|
||||
|
||||
@@ -186,6 +186,7 @@ iD.modes.DragNode = function(context) {
|
||||
};
|
||||
|
||||
mode.exit = function() {
|
||||
context.ui().sidebar.hover.cancel();
|
||||
context.uninstall(hover);
|
||||
context.uninstall(edit);
|
||||
|
||||
|
||||
+5
-4
@@ -12,8 +12,8 @@ iD.ui.Sidebar = function(context) {
|
||||
var inspectorWrap = selection.append('div')
|
||||
.attr('class', 'inspector-hidden inspector-wrap fr');
|
||||
|
||||
sidebar.hover = function(id) {
|
||||
if (!current && id) {
|
||||
function hover(id) {
|
||||
if (!current && context.hasEntity(id)) {
|
||||
featureListWrap.classed('inspector-hidden', true);
|
||||
inspectorWrap.classed('inspector-hidden', false)
|
||||
.classed('inspector-hover', true);
|
||||
@@ -30,9 +30,9 @@ iD.ui.Sidebar = function(context) {
|
||||
inspectorWrap.classed('inspector-hidden', true);
|
||||
inspector.state('hide');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
sidebar.hover = _.throttle(sidebar.hover, 200);
|
||||
sidebar.hover = _.throttle(hover, 200);
|
||||
|
||||
sidebar.select = function(id, newFeature) {
|
||||
if (!current && id) {
|
||||
@@ -73,6 +73,7 @@ iD.ui.Sidebar = function(context) {
|
||||
}
|
||||
|
||||
sidebar.hover = function() {};
|
||||
sidebar.hover.cancel = function() {};
|
||||
sidebar.select = function() {};
|
||||
sidebar.show = function() {};
|
||||
sidebar.hide = function() {};
|
||||
|
||||
Reference in New Issue
Block a user