Permalink
Browse files

Merge pull request #248 from manubb/master

Simplication in handlers activation/desactivation.
  • Loading branch information...
jacobtoye committed Dec 19, 2013
2 parents c1c01dd + a3a1657 commit 7db316ea80183728516f57c9049ccd14fdb463f5
Showing with 2 additions and 9 deletions.
  1. +1 −3 src/Toolbar.js
  2. +1 −6 src/edit/EditToolbar.js
View
@@ -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];
View
@@ -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; }

0 comments on commit 7db316e

Please sign in to comment.