Skip to content

Commit

Permalink
Update build and CHANGLOG
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobtoye committed Dec 19, 2013
1 parent 8ff11e9 commit c214aeb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 25 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ An in-progress version being developed on the master branch.
* Fix issue where toolbar buttons would have focus after clicked so couldn't use escape to cancel until clicked map at least once.
* Fix toolbar icons for retina displays. (by [@dwnoble](https://github.com/dwnoble)). [#217](https://github.com/Leaflet/Leaflet.draw/pull/217)
* Ensure that options are not shared between draw handler classes. (by [@yohanboniface](https://github.com/yohanboniface). [#219](https://github.com/Leaflet/Leaflet.draw/pull/219)
* Fix bug where multiple handlers could be active. (by [@manubb](https://github.com/manubb). [#247](https://github.com/Leaflet/Leaflet.draw/pull/247)

## 0.2.2 (October 4, 2013)

Expand Down
47 changes: 24 additions & 23 deletions dist/leaflet.draw-src.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,21 +126,21 @@ L.Draw.Feature = L.Handler.extend({
enable: function () {
if (this._enabled) { return; }

L.Handler.prototype.enable.call(this);

this.fire('enabled', { handler: this.type });

this._map.fire('draw:drawstart', { layerType: this.type });

L.Handler.prototype.enable.call(this);
},

disable: function () {
if (!this._enabled) { return; }

L.Handler.prototype.disable.call(this);

this.fire('disabled', { handler: this.type });

this._map.fire('draw:drawstop', { layerType: this.type });

this.fire('disabled', { handler: this.type });
},

addHooks: function () {
Expand Down Expand Up @@ -2412,7 +2412,12 @@ 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 Expand Up @@ -2498,28 +2503,26 @@ L.EditToolbar.Edit = L.Handler.extend({
if (this._enabled || !this._hasAvailableLayers()) {
return;
}
this.fire('enabled', {handler: this.type});
//this disable other handlers

L.Handler.prototype.enable.call(this);
this._map.fire('draw:editstart', { handler: this.type });
//allow drawLayer to be updated before beginning edition.

L.Handler.prototype.enable.call(this);
this._featureGroup
.on('layeradd', this._enableLayerEdit, this)
.on('layerremove', this._disableLayerEdit, this);

this.fire('enabled', {handler: this.type});
this._map.fire('draw:editstart', { handler: this.type });
},

disable: function () {
if (!this._enabled) { return; }

this.fire('disabled', {handler: this.type});
this._map.fire('draw:editstop', { handler: this.type });

this._featureGroup
.off('layeradd', this._enableLayerEdit, this)
.off('layerremove', this._disableLayerEdit, this);

L.Handler.prototype.disable.call(this);
this._map.fire('draw:editstop', { handler: this.type });
this.fire('disabled', {handler: this.type});
},

addHooks: function () {
Expand Down Expand Up @@ -2748,28 +2751,26 @@ L.EditToolbar.Delete = L.Handler.extend({
if (this._enabled || !this._hasAvailableLayers()) {
return;
}
this.fire('enabled', { handler: this.type});
//this disable other handlers

L.Handler.prototype.enable.call(this);
this._map.fire('draw:deletestart', { handler: this.type });
//allow drawLayer to be updated before beginning deletion.

L.Handler.prototype.enable.call(this);
this._deletableLayers
.on('layeradd', this._enableLayerDelete, this)
.on('layerremove', this._disableLayerDelete, this);

this.fire('enabled', { handler: this.type});
this._map.fire('draw:editstart', { handler: this.type });
},

disable: function () {
if (!this._enabled) { return; }

L.Handler.prototype.disable.call(this);

this._deletableLayers
.off('layeradd', this._enableLayerDelete, this)
.off('layerremove', this._disableLayerDelete, this);

L.Handler.prototype.disable.call(this);
this._map.fire('draw:deletestop', { handler: this.type });
this.fire('disabled', { handler: this.type});
this._map.fire('draw:editstop', { handler: this.type });
},

addHooks: function () {
Expand Down
Loading

0 comments on commit c214aeb

Please sign in to comment.