Skip to content

Commit

Permalink
Give popups an id
Browse files Browse the repository at this point in the history
Useful for selecting individual popups after creation. Especially in the case where having a class is too general and finer-grain control is necessary.
  • Loading branch information
tylercubell committed Mar 30, 2016
1 parent 333899c commit 4a86f3c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/layer/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ L.Popup = L.Class.extend({
offset: new L.Point(0, 6),
autoPanPadding: new L.Point(5, 5),
className: '',
id: '',
zoomAnimation: true
},

Expand Down Expand Up @@ -119,6 +120,10 @@ L.Popup = L.Class.extend({
container = this._container = L.DomUtil.create('div', containerClass),
closeButton;

if (this.options.id !== '') {
container.id = this.options.id;
}

if (this.options.closeButton) {
closeButton = this._closeButton =
L.DomUtil.create('a', prefix + '-close-button', container);
Expand Down

0 comments on commit 4a86f3c

Please sign in to comment.