X-Git-Url: https://git.openstreetmap.org/rails.git/blobdiff_plain/cb87f02642d0097ebc067ca1f9371dde274a41e3..10294f4849b5d97185c618687a710a2dfc19f148:/vendor/assets/leaflet/leaflet.contextmenu.js diff --git a/vendor/assets/leaflet/leaflet.contextmenu.js b/vendor/assets/leaflet/leaflet.contextmenu.js index a9b011d95..58cd4d7bf 100644 --- a/vendor/assets/leaflet/leaflet.contextmenu.js +++ b/vendor/assets/leaflet/leaflet.contextmenu.js @@ -144,16 +144,22 @@ L.Map.ContextMenu = L.Handler.extend({ contextmenu: this, el: item }); + + return item; } + + return null; }, removeAllItems: function () { - var item; + var items = this._container.children, + item; - while (this._container.children.length) { - item = this._container.children[0]; + while (items.length) { + item = items[0]; this._removeItem(L.Util.stamp(item)); } + return items; }, hideAllItems: function () { @@ -322,7 +328,7 @@ L.Map.ContextMenu = L.Handler.extend({ func.call(context || map, me._showLocation); } - me._map.fire('contextmenu:select', { + me._map.fire('contextmenu.select', { contextmenu: me, el: el });