From ef03a45d484d1243b6f14a332136990f092298d1 Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Fri, 9 Aug 2013 14:41:47 -0700 Subject: [PATCH] Don't update entity editor when it's hidden --- js/id/ui/entity_editor.js | 1 + js/id/ui/inspector.js | 1 + js/id/ui/sidebar.js | 2 ++ 3 files changed, 4 insertions(+) diff --git a/js/id/ui/entity_editor.js b/js/id/ui/entity_editor.js index 411fbf6d3..53ba37c1b 100644 --- a/js/id/ui/entity_editor.js +++ b/js/id/ui/entity_editor.js @@ -120,6 +120,7 @@ iD.ui.EntityEditor = function(context) { .entityID(id)); function historyChanged() { + if (state === 'hide') return; var entity = context.hasEntity(id); if (!entity) return; entityEditor.preset(context.presets().match(entity, context.graph())); diff --git a/js/id/ui/inspector.js b/js/id/ui/inspector.js index bc604dc8a..9edefc73b 100644 --- a/js/id/ui/inspector.js +++ b/js/id/ui/inspector.js @@ -75,6 +75,7 @@ iD.ui.Inspector = function(context) { inspector.state = function(_) { if (!arguments.length) return state; state = _; + entityEditor.state(state); return inspector; }; diff --git a/js/id/ui/sidebar.js b/js/id/ui/sidebar.js index 0fee5d907..b3c7294d1 100644 --- a/js/id/ui/sidebar.js +++ b/js/id/ui/sidebar.js @@ -28,6 +28,7 @@ iD.ui.Sidebar = function(context) { } else if (!current) { featureListWrap.classed('inspector-hidden', false); inspectorWrap.classed('inspector-hidden', true); + inspector.state('hide'); } }; @@ -48,6 +49,7 @@ iD.ui.Sidebar = function(context) { } else if (!current) { featureListWrap.classed('inspector-hidden', false); inspectorWrap.classed('inspector-hidden', true); + inspector.state('hide'); } };