Skip to content

Commit

Permalink
Merge pull request #248 from manubb/master
Browse files Browse the repository at this point in the history
Simplication in handlers activation/desactivation.
  • Loading branch information
jacobtoye committed Dec 19, 2013
2 parents c1c01dd + a3a1657 commit 7db316e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
4 changes: 1 addition & 3 deletions src/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
7 changes: 1 addition & 6 deletions src/edit/EditToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -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; }

Expand Down

0 comments on commit 7db316e

Please sign in to comment.