Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.
Open
Changes from all commits
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
12 changes: 12 additions & 0 deletions Leaflet.Dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ L.Control.Dialog = L.Control.extend({
return;
}
this._container.style.visibility = "";
this._toogle = this.close;

this._map.fire("dialog:opened", this);

Expand All @@ -41,11 +42,21 @@ L.Control.Dialog = L.Control.extend({

close: function() {
this._container.style.visibility = "hidden";
this._toogle = this.open;

this._map.fire("dialog:closed", this);
return this;
},

toggle: function(){
return this._toggle();
},

_toggle: function(){
// update, open, and close change _toggle as needed
return this;
},

destroy: function() {
if (!this._map) {
return this;
Expand Down Expand Up @@ -174,6 +185,7 @@ L.Control.Dialog = L.Control.extend({
this._updateLayout();

this._container.style.visibility = "";
this._toggle = this.close;
this._map.fire("dialog:updated", this);
},

Expand Down