]> git.openstreetmap.org Git - rails.git/blobdiff - vendor/assets/leaflet/leaflet.contextmenu.js
Merge remote-tracking branch 'upstream/pull/2412'
[rails.git] / vendor / assets / leaflet / leaflet.contextmenu.js
index a9b011d9519c685bafa3d66feb166e0a72294f8d..58cd4d7bfb6b5568fddd7cea51ff15fac4e7e45c 100644 (file)
@@ -144,16 +144,22 @@ L.Map.ContextMenu = L.Handler.extend({
                 contextmenu: this,
                 el: item
             });
                 contextmenu: this,
                 el: item
             });
+
+            return item;
         }
         }
+
+        return null;
     },
 
     removeAllItems: function () {
     },
 
     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));
         }
             this._removeItem(L.Util.stamp(item));
         }
+        return items;
     },
 
     hideAllItems: function () {
     },
 
     hideAllItems: function () {
@@ -322,7 +328,7 @@ L.Map.ContextMenu = L.Handler.extend({
                 func.call(context || map, me._showLocation);
             }
 
                 func.call(context || map, me._showLocation);
             }
 
-            me._map.fire('contextmenu:select', {
+            me._map.fire('contextmenu.select', {
                 contextmenu: me,
                 el: el
             });
                 contextmenu: me,
                 el: el
             });