From e35867dd7a1863ff7f34c92e8bef7f46c04dceb8 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Mon, 15 Jan 2018 10:25:21 +0000 Subject: [PATCH] Update the Leaflet.contextmenu plugin to 1.5.0 --- Vendorfile | 2 +- vendor/assets/leaflet/leaflet.contextmenu.js | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Vendorfile b/Vendorfile index 05edd0ca4..e64e74e44 100644 --- a/Vendorfile +++ b/Vendorfile @@ -20,7 +20,7 @@ folder 'vendor/assets' do file "images/#{image}", "https://unpkg.com/leaflet@1.3.0/dist/images/#{image}" end - from 'git://github.com/aratcliffe/Leaflet.contextmenu.git', :tag => 'v1.2.1' do + from 'git://github.com/aratcliffe/Leaflet.contextmenu.git', :tag => 'v1.5.0' do file 'leaflet.contextmenu.js', 'dist/leaflet.contextmenu.js' file 'leaflet.contextmenu.css', 'dist/leaflet.contextmenu.css' end 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 }); -- 2.39.5