Skip to content

Commit

Permalink
Add revert events for a layer when the edit or delete is canceled. refs
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtoye committed Oct 3, 2014
1 parent 98c14c0 commit 8125fae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/edit/handler/EditToolbar.Delete.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ L.EditToolbar.Delete = L.Handler.extend({
// Iterate of the deleted layers and add them back into the featureGroup
this._deletedLayers.eachLayer(function (layer) {
this._deletableLayers.addLayer(layer);
layer.fire('revert-deleted', { layer: layer });
}, this);
},

Expand Down
2 changes: 2 additions & 0 deletions src/edit/handler/EditToolbar.Edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ L.EditToolbar.Edit = L.Handler.extend({
} else if (layer instanceof L.Marker) { // Marker
layer.setLatLng(this._uneditedLayerProps[id].latlng);
}

layer.fire('revert-edited', { layer: layer });
}
},

Expand Down

0 comments on commit 8125fae

Please sign in to comment.