Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit/delete handler bug. #247

Merged
merged 4 commits into from
Dec 19, 2013
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
When in edit/delete mode, revertLayers has to be called
when another handler is clicked on.
  • Loading branch information
Manuel Baclet committed Dec 18, 2013
commit 61c9841c095ac115dbaf15c5d68497de61201f92
9 changes: 7 additions & 2 deletions src/edit/EditToolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,12 @@ L.EditToolbar = L.Toolbar.extend({

this.options.featureGroup.off('layeradd layerremove', this._checkDisabled, 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 Expand Up @@ -164,4 +169,4 @@ if (!L.DomUtil.toggleClass) {
}
}
});
}
}