diff --git a/js/iD/controller/edit/EditBaseState.js b/js/iD/controller/edit/EditBaseState.js index 67d0a92dc..64e07ffe5 100644 --- a/js/iD/controller/edit/EditBaseState.js +++ b/js/iD/controller/edit/EditBaseState.js @@ -24,7 +24,7 @@ declare("iD.controller.edit.EditBaseState", [iD.controller.ControllerState], { }, closeEditorTooltip:function() { - dijit.popup.close(editortooltip); + if (this.editortooltip) { dijit.popup.close(editortooltip); } }, }); diff --git a/js/iD/controller/edit/SelectedWay.js b/js/iD/controller/edit/SelectedWay.js index 3beb146bb..3c6902cc6 100755 --- a/js/iD/controller/edit/SelectedWay.js +++ b/js/iD/controller/edit/SelectedWay.js @@ -19,7 +19,7 @@ declare("iD.controller.edit.SelectedWay", [iD.controller.edit.EditBaseState], { this.wayUI=this.controller.map.getUI(this.way); this.wayUI.setStateClass('selected'); this.wayUI.setStateClass('shownodes'); - this.openEditorTooltip(this.entryevent.clientX, this.entryevent.clientY); + if (this.entryevent) { this.openEditorTooltip(this.entryevent.clientX, this.entryevent.clientY); } this.wayUI.redraw(); }, exitState:function() { diff --git a/js/iD/controller/shape/DrawWay.js b/js/iD/controller/shape/DrawWay.js index 00e015f63..292988b7a 100644 --- a/js/iD/controller/shape/DrawWay.js +++ b/js/iD/controller/shape/DrawWay.js @@ -94,12 +94,12 @@ declare("iD.controller.shape.DrawWay", [iD.controller.ControllerState], { if (entity==this.getDrawingNode()) { // Double-click, so complete drawing this.controller.stepper.highlight('tag'); - return new iD.controller.edit.SelectedWay(this.way, event); + return new iD.controller.edit.SelectedWay(this.way, null); } else if (entity==this.getStartNode()) { // Start of this way, so complete drawing this.appendNode(entity, this.undoAdder() ); this.controller.stepper.highlight('tag'); - return new iD.controller.edit.SelectedWay(this.way, event); + return new iD.controller.edit.SelectedWay(this.way, null); } else { // Add to way this.appendNode(entity, this.undoAdder() );