diff --git a/src/Toolbar.js b/src/Toolbar.js index 2a14bfe4e..671e13ad3 100644 --- a/src/Toolbar.js +++ b/src/Toolbar.js @@ -148,9 +148,7 @@ L.Toolbar = L.Class.extend({ _handlerActivated: function (e) { // Disable active mode (if present) - if (this._activeMode && this._activeMode.handler.enabled()) { - this._activeMode.handler.disable(); - } + this.disable(); // Cache new active feature this._activeMode = this._modes[e.handler]; diff --git a/src/edit/EditToolbar.js b/src/edit/EditToolbar.js index e2655b570..67207e970 100644 --- a/src/edit/EditToolbar.js +++ b/src/edit/EditToolbar.js @@ -91,12 +91,7 @@ L.EditToolbar = L.Toolbar.extend({ L.Toolbar.prototype.removeToolbar.call(this); }, - _handlerActivated: function (e) { - if (this._activeMode && this._activeMode.handler.enabled()) { - this._activeMode.handler.revertLayers(); - } - L.Toolbar.prototype._handlerActivated.call(this, e); - }, + disable: function () { if (!this.enabled()) { return; }