From 0deb1d461e5d3778c2a12d82850fc3f28329f428 Mon Sep 17 00:00:00 2001 From: johndoe Date: Wed, 13 Mar 2019 11:25:30 +0200 Subject: [PATCH] external: Control.MiniMap.js update to 30eff5568645bf2bdab86b9e2d8fa6b459a33966 (v3.6.1-4-gf5bfff8) Control.MiniMap.css Control.MiniMap.js images/ toggle.png toggle.svg plugin minimap: use @@INCLUDECSS macro --- external/Control.MiniMap.css | 4 ++-- external/Control.MiniMap.js | 21 +++++++++++++++++++++ images/minimap-toggle.png | Bin 560 -> 0 bytes images/toggle.png | Bin 0 -> 219 bytes images/{minimap-toggle.svg => toggle.svg} | 0 plugins/minimap.user.js | 4 ++-- 6 files changed, 25 insertions(+), 4 deletions(-) delete mode 100644 images/minimap-toggle.png create mode 100644 images/toggle.png rename images/{minimap-toggle.svg => toggle.svg} (100%) diff --git a/external/Control.MiniMap.css b/external/Control.MiniMap.css index 9b2d65a82..666047c16 100644 --- a/external/Control.MiniMap.css +++ b/external/Control.MiniMap.css @@ -38,14 +38,14 @@ } .leaflet-control-minimap-toggle-display{ - background-image: url(@@INCLUDEIMAGE:images/minimap-toggle.png@@); + background-image: url("images/toggle.svg"); background-size: cover; position: absolute; border-radius: 3px 0px 0px 0px; } .leaflet-oldie .leaflet-control-minimap-toggle-display{ - background-image: url(@@INCLUDEIMAGE:images/minimap-toggle.png@@); + background-image: url("images/toggle.png"); } .leaflet-control-minimap-toggle-display-bottomright { diff --git a/external/Control.MiniMap.js b/external/Control.MiniMap.js index f897c2fb2..810eec40c 100644 --- a/external/Control.MiniMap.js +++ b/external/Control.MiniMap.js @@ -20,6 +20,9 @@ }(function (L) { var MiniMap = L.Control.extend({ + + includes: L.Evented ? L.Evented.prototype : L.Mixin.Events, + options: { position: 'bottomright', toggleDisplay: false, @@ -190,6 +193,7 @@ this._container.style.display = 'none'; } this._minimized = true; + this._onToggle(); }, _restore: function () { @@ -203,6 +207,7 @@ this._container.style.display = 'block'; } this._minimized = false; + this._onToggle(); }, _onMainMapMoved: function (e) { @@ -313,6 +318,22 @@ _isDefined: function (value) { return typeof value !== 'undefined'; + }, + + _onToggle: function () { + L.Util.requestAnimFrame(function () { + L.DomEvent.on(this._container, 'transitionend', this._fireToggleEvents, this); + if (!L.Browser.any3d) { + L.Util.requestAnimFrame(this._fireToggleEvents, this); + } + }, this); + }, + + _fireToggleEvents: function () { + L.DomEvent.off(this._container, 'transitionend', this._fireToggleEvents, this); + var data = { minimized: this._minimized }; + this.fire(this._minimized ? 'minimize' : 'restore', data); + this.fire('toggle', data); } }); diff --git a/images/minimap-toggle.png b/images/minimap-toggle.png deleted file mode 100644 index 026d4c8bbc37882a9b685b7a685917b0651aadf2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 560 zcmV-00?+-4P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2i*Y> z00=daXO&d|00FQ`L_t(Y$L-ZWOCv!T2Jm-XS&Pe_780^@R>Dg-F!&F<183lhkmkz! z0M}S62Zy}}#xD^37_tN*nY?0kSh*m?fyi~UOb`xstA%B3A{>&9yRpzBPdV`Z28MZN z0A`sg#u(cevruGaZroxJ1mC*d?zz_bL&io6xuD^2csLjgzWTm@8HVBVGh~g3&T>Ju zT8$jXfh0+`g%B4?spS!}N<Pacr#?8!U z9bTnUIZ{gf6GEKCas1i${Xc1%7CY>xc%IkfoRe+aFbR1PGRB}1T{%xXK!yN)%XA{GEFjcT+A05$-81b_$2vi|0RTCJAJ@HHZS zVT{Q_?SGaBMC9X;B2a{gb;j83RPWJKY}>x8R;zOAhi!yJX`1c`A+D5CpQeHk@n@sa z*esPw!#IxDd%fOu7>3)0AVfT7j5R&a8*t9QyRMr=QB-NS+g+{oPA&)$e>298{`&+3 y=lqA`I3`Jw`ydGJUUhr5*881KXJyvoH_jtgYr?XBn0V0u0000O=u<5X=vX`o=Or;B5VMeo}ShFnaB0<91IKe&Xg{K{0tpRNCFZqAyNL_wG2je>2i zik#DaAJ%S5tcyG3q_4f^zoJ$0k%!0au6C_EQBgBd^-h-S?Mp9|Z?k*qtxPkYJlEh$ z$Fog6;p;j29$GBxOsVqAxunx2fBSAmv$utm_q)`(Z6;AODwsQ2jn9Xkz3K{d2!p4q KpUXO@geCxZeN8d| literal 0 HcmV?d00001 diff --git a/images/minimap-toggle.svg b/images/toggle.svg similarity index 100% rename from images/minimap-toggle.svg rename to images/toggle.svg diff --git a/plugins/minimap.user.js b/plugins/minimap.user.js index d8c613c2f..1244aee21 100644 --- a/plugins/minimap.user.js +++ b/plugins/minimap.user.js @@ -2,7 +2,7 @@ // @id iitc-plugin-minimap@breunigs // @name IITC plugin: Mini map // @category Controls -// @version 0.2.0.@@DATETIMEVERSION@@ +// @version 0.3.0.@@DATETIMEVERSION@@ // @description [@@BUILDNAME@@-@@BUILDDATE@@] Show a mini map on the corner of the map. @@METAINFO@@ // ==/UserScript== @@ -32,7 +32,7 @@ window.plugin.miniMap.setup = function() { new L.Control.MiniMap(L.gridLayer.googleMutant('ROADMAP',{maxZoom:21}), {toggleDisplay: true, position: position}).addTo(window.map); }, 0); - $('head').append(''); + $('head').append(''); }; var setup = window.plugin.miniMap.setup;