From 2f6701496154c1bf71ad14caf36f83829c3a619f Mon Sep 17 00:00:00 2001 From: csxphil Date: Fri, 8 Sep 2017 17:35:08 -0400 Subject: [PATCH 1/4] Update leaflet-sidebar.js Updating to match with Leaflet 1.2.0 --- js/leaflet-sidebar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/leaflet-sidebar.js b/js/leaflet-sidebar.js index b28bbe1..f1a5a7c 100644 --- a/js/leaflet-sidebar.js +++ b/js/leaflet-sidebar.js @@ -8,7 +8,7 @@ * @see L.control.sidebar */ L.Control.Sidebar = L.Control.extend(/** @lends L.Control.Sidebar.prototype */ { - includes: L.Mixin.Events, + includes: L.Evented.prototype, options: { position: 'left' From 50165a5b92352821bbd793eba912bb772991afa7 Mon Sep 17 00:00:00 2001 From: csxphil Date: Fri, 8 Sep 2017 17:35:43 -0400 Subject: [PATCH 2/4] Update leaflet-sidebar.min.js Making change to update to Leaflet 1.2.0 --- js/leaflet-sidebar.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/leaflet-sidebar.min.js b/js/leaflet-sidebar.min.js index 09b4c54..6fe16d7 100644 --- a/js/leaflet-sidebar.min.js +++ b/js/leaflet-sidebar.min.js @@ -1 +1 @@ -L.Control.Sidebar=L.Control.extend({includes:L.Mixin.Events,options:{position:"left"},initialize:function(t,s){var i,e;for(L.setOptions(this,s),this._sidebar=L.DomUtil.get(t),L.DomUtil.addClass(this._sidebar,"sidebar-"+this.options.position),L.Browser.touch&&L.DomUtil.addClass(this._sidebar,"leaflet-touch"),i=this._sidebar.children.length-1;i>=0;i--)e=this._sidebar.children[i],"DIV"==e.tagName&&L.DomUtil.hasClass(e,"sidebar-content")&&(this._container=e);for(this._tabitems=this._sidebar.querySelectorAll("ul.sidebar-tabs > li, .sidebar-tabs > ul > li"),i=this._tabitems.length-1;i>=0;i--)this._tabitems[i]._sidebar=this;for(this._panes=[],this._closeButtons=[],i=this._container.children.length-1;i>=0;i--)if(e=this._container.children[i],"DIV"==e.tagName&&L.DomUtil.hasClass(e,"sidebar-pane")){this._panes.push(e);for(var o=e.querySelectorAll(".sidebar-close"),a=0,l=o.length;l>a;a++)this._closeButtons.push(o[a])}},addTo:function(t){var s,i;for(this._map=t,s=this._tabitems.length-1;s>=0;s--){i=this._tabitems[s];var e=i.querySelector("a");e.hasAttribute("href")&&"#"==e.getAttribute("href").slice(0,1)&&L.DomEvent.on(e,"click",L.DomEvent.preventDefault).on(e,"click",this._onClick,i)}for(s=this._closeButtons.length-1;s>=0;s--)i=this._closeButtons[s],L.DomEvent.on(i,"click",this._onCloseClick,this);return this},removeFrom:function(t){console.log("removeFrom() has been deprecated, please use remove() instead as support for this function will be ending soon."),this.remove(t)},remove:function(){var t,s;for(this._map=null,t=this._tabitems.length-1;t>=0;t--)s=this._tabitems[t],L.DomEvent.off(s.querySelector("a"),"click",this._onClick);for(t=this._closeButtons.length-1;t>=0;t--)s=this._closeButtons[t],L.DomEvent.off(s,"click",this._onCloseClick,this);return this},open:function(t){var s,i;for(s=this._panes.length-1;s>=0;s--)i=this._panes[s],i.id==t?L.DomUtil.addClass(i,"active"):L.DomUtil.hasClass(i,"active")&&L.DomUtil.removeClass(i,"active");for(s=this._tabitems.length-1;s>=0;s--)i=this._tabitems[s],i.querySelector("a").hash=="#"+t?L.DomUtil.addClass(i,"active"):L.DomUtil.hasClass(i,"active")&&L.DomUtil.removeClass(i,"active");return this.fire("content",{id:t}),L.DomUtil.hasClass(this._sidebar,"collapsed")&&(this.fire("opening"),L.DomUtil.removeClass(this._sidebar,"collapsed")),this},close:function(){for(var t=this._tabitems.length-1;t>=0;t--){var s=this._tabitems[t];L.DomUtil.hasClass(s,"active")&&L.DomUtil.removeClass(s,"active")}return L.DomUtil.hasClass(this._sidebar,"collapsed")||(this.fire("closing"),L.DomUtil.addClass(this._sidebar,"collapsed")),this},_onClick:function(){L.DomUtil.hasClass(this,"active")?this._sidebar.close():L.DomUtil.hasClass(this,"disabled")||this._sidebar.open(this.querySelector("a").hash.slice(1))},_onCloseClick:function(){this.close()}}),L.control.sidebar=function(t,s){return new L.Control.Sidebar(t,s)}; \ No newline at end of file +L.Control.Sidebar=L.Control.extend({includes:L.Evented.prototype,options:{position:"left"},initialize:function(t,s){var i,e;for(L.setOptions(this,s),this._sidebar=L.DomUtil.get(t),L.DomUtil.addClass(this._sidebar,"sidebar-"+this.options.position),L.Browser.touch&&L.DomUtil.addClass(this._sidebar,"leaflet-touch"),i=this._sidebar.children.length-1;i>=0;i--)e=this._sidebar.children[i],"DIV"==e.tagName&&L.DomUtil.hasClass(e,"sidebar-content")&&(this._container=e);for(this._tabitems=this._sidebar.querySelectorAll("ul.sidebar-tabs > li, .sidebar-tabs > ul > li"),i=this._tabitems.length-1;i>=0;i--)this._tabitems[i]._sidebar=this;for(this._panes=[],this._closeButtons=[],i=this._container.children.length-1;i>=0;i--)if(e=this._container.children[i],"DIV"==e.tagName&&L.DomUtil.hasClass(e,"sidebar-pane")){this._panes.push(e);for(var o=e.querySelectorAll(".sidebar-close"),a=0,l=o.length;l>a;a++)this._closeButtons.push(o[a])}},addTo:function(t){var s,i;for(this._map=t,s=this._tabitems.length-1;s>=0;s--){i=this._tabitems[s];var e=i.querySelector("a");e.hasAttribute("href")&&"#"==e.getAttribute("href").slice(0,1)&&L.DomEvent.on(e,"click",L.DomEvent.preventDefault).on(e,"click",this._onClick,i)}for(s=this._closeButtons.length-1;s>=0;s--)i=this._closeButtons[s],L.DomEvent.on(i,"click",this._onCloseClick,this);return this},removeFrom:function(t){console.log("removeFrom() has been deprecated, please use remove() instead as support for this function will be ending soon."),this.remove(t)},remove:function(){var t,s;for(this._map=null,t=this._tabitems.length-1;t>=0;t--)s=this._tabitems[t],L.DomEvent.off(s.querySelector("a"),"click",this._onClick);for(t=this._closeButtons.length-1;t>=0;t--)s=this._closeButtons[t],L.DomEvent.off(s,"click",this._onCloseClick,this);return this},open:function(t){var s,i;for(s=this._panes.length-1;s>=0;s--)i=this._panes[s],i.id==t?L.DomUtil.addClass(i,"active"):L.DomUtil.hasClass(i,"active")&&L.DomUtil.removeClass(i,"active");for(s=this._tabitems.length-1;s>=0;s--)i=this._tabitems[s],i.querySelector("a").hash=="#"+t?L.DomUtil.addClass(i,"active"):L.DomUtil.hasClass(i,"active")&&L.DomUtil.removeClass(i,"active");return this.fire("content",{id:t}),L.DomUtil.hasClass(this._sidebar,"collapsed")&&(this.fire("opening"),L.DomUtil.removeClass(this._sidebar,"collapsed")),this},close:function(){for(var t=this._tabitems.length-1;t>=0;t--){var s=this._tabitems[t];L.DomUtil.hasClass(s,"active")&&L.DomUtil.removeClass(s,"active")}return L.DomUtil.hasClass(this._sidebar,"collapsed")||(this.fire("closing"),L.DomUtil.addClass(this._sidebar,"collapsed")),this},_onClick:function(){L.DomUtil.hasClass(this,"active")?this._sidebar.close():L.DomUtil.hasClass(this,"disabled")||this._sidebar.open(this.querySelector("a").hash.slice(1))},_onCloseClick:function(){this.close()}}),L.control.sidebar=function(t,s){return new L.Control.Sidebar(t,s)}; From cfd018d1b3f03c6babca1ce626ff8d0687899981 Mon Sep 17 00:00:00 2001 From: csxphil Date: Fri, 8 Sep 2017 17:40:53 -0400 Subject: [PATCH 3/4] Update leaflet-sidebar.js Making sure it is still usable by older versions of Leaflet. --- js/leaflet-sidebar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/leaflet-sidebar.js b/js/leaflet-sidebar.js index f1a5a7c..4283a29 100644 --- a/js/leaflet-sidebar.js +++ b/js/leaflet-sidebar.js @@ -8,7 +8,7 @@ * @see L.control.sidebar */ L.Control.Sidebar = L.Control.extend(/** @lends L.Control.Sidebar.prototype */ { - includes: L.Evented.prototype, + includes: (L.Evented.prototype || L.Mixin.Events), options: { position: 'left' From d0a34a245050bf8aaf153dcbc8cbfeb2ba47c928 Mon Sep 17 00:00:00 2001 From: csxphil Date: Fri, 8 Sep 2017 17:41:42 -0400 Subject: [PATCH 4/4] Update leaflet-sidebar.min.js Making sure still compatible for older versions of leaflet --- js/leaflet-sidebar.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/leaflet-sidebar.min.js b/js/leaflet-sidebar.min.js index 6fe16d7..c880499 100644 --- a/js/leaflet-sidebar.min.js +++ b/js/leaflet-sidebar.min.js @@ -1 +1 @@ -L.Control.Sidebar=L.Control.extend({includes:L.Evented.prototype,options:{position:"left"},initialize:function(t,s){var i,e;for(L.setOptions(this,s),this._sidebar=L.DomUtil.get(t),L.DomUtil.addClass(this._sidebar,"sidebar-"+this.options.position),L.Browser.touch&&L.DomUtil.addClass(this._sidebar,"leaflet-touch"),i=this._sidebar.children.length-1;i>=0;i--)e=this._sidebar.children[i],"DIV"==e.tagName&&L.DomUtil.hasClass(e,"sidebar-content")&&(this._container=e);for(this._tabitems=this._sidebar.querySelectorAll("ul.sidebar-tabs > li, .sidebar-tabs > ul > li"),i=this._tabitems.length-1;i>=0;i--)this._tabitems[i]._sidebar=this;for(this._panes=[],this._closeButtons=[],i=this._container.children.length-1;i>=0;i--)if(e=this._container.children[i],"DIV"==e.tagName&&L.DomUtil.hasClass(e,"sidebar-pane")){this._panes.push(e);for(var o=e.querySelectorAll(".sidebar-close"),a=0,l=o.length;l>a;a++)this._closeButtons.push(o[a])}},addTo:function(t){var s,i;for(this._map=t,s=this._tabitems.length-1;s>=0;s--){i=this._tabitems[s];var e=i.querySelector("a");e.hasAttribute("href")&&"#"==e.getAttribute("href").slice(0,1)&&L.DomEvent.on(e,"click",L.DomEvent.preventDefault).on(e,"click",this._onClick,i)}for(s=this._closeButtons.length-1;s>=0;s--)i=this._closeButtons[s],L.DomEvent.on(i,"click",this._onCloseClick,this);return this},removeFrom:function(t){console.log("removeFrom() has been deprecated, please use remove() instead as support for this function will be ending soon."),this.remove(t)},remove:function(){var t,s;for(this._map=null,t=this._tabitems.length-1;t>=0;t--)s=this._tabitems[t],L.DomEvent.off(s.querySelector("a"),"click",this._onClick);for(t=this._closeButtons.length-1;t>=0;t--)s=this._closeButtons[t],L.DomEvent.off(s,"click",this._onCloseClick,this);return this},open:function(t){var s,i;for(s=this._panes.length-1;s>=0;s--)i=this._panes[s],i.id==t?L.DomUtil.addClass(i,"active"):L.DomUtil.hasClass(i,"active")&&L.DomUtil.removeClass(i,"active");for(s=this._tabitems.length-1;s>=0;s--)i=this._tabitems[s],i.querySelector("a").hash=="#"+t?L.DomUtil.addClass(i,"active"):L.DomUtil.hasClass(i,"active")&&L.DomUtil.removeClass(i,"active");return this.fire("content",{id:t}),L.DomUtil.hasClass(this._sidebar,"collapsed")&&(this.fire("opening"),L.DomUtil.removeClass(this._sidebar,"collapsed")),this},close:function(){for(var t=this._tabitems.length-1;t>=0;t--){var s=this._tabitems[t];L.DomUtil.hasClass(s,"active")&&L.DomUtil.removeClass(s,"active")}return L.DomUtil.hasClass(this._sidebar,"collapsed")||(this.fire("closing"),L.DomUtil.addClass(this._sidebar,"collapsed")),this},_onClick:function(){L.DomUtil.hasClass(this,"active")?this._sidebar.close():L.DomUtil.hasClass(this,"disabled")||this._sidebar.open(this.querySelector("a").hash.slice(1))},_onCloseClick:function(){this.close()}}),L.control.sidebar=function(t,s){return new L.Control.Sidebar(t,s)}; +L.Control.Sidebar=L.Control.extend({includes:(L.Evented.prototype || L.Mixin.Events),options:{position:"left"},initialize:function(t,s){var i,e;for(L.setOptions(this,s),this._sidebar=L.DomUtil.get(t),L.DomUtil.addClass(this._sidebar,"sidebar-"+this.options.position),L.Browser.touch&&L.DomUtil.addClass(this._sidebar,"leaflet-touch"),i=this._sidebar.children.length-1;i>=0;i--)e=this._sidebar.children[i],"DIV"==e.tagName&&L.DomUtil.hasClass(e,"sidebar-content")&&(this._container=e);for(this._tabitems=this._sidebar.querySelectorAll("ul.sidebar-tabs > li, .sidebar-tabs > ul > li"),i=this._tabitems.length-1;i>=0;i--)this._tabitems[i]._sidebar=this;for(this._panes=[],this._closeButtons=[],i=this._container.children.length-1;i>=0;i--)if(e=this._container.children[i],"DIV"==e.tagName&&L.DomUtil.hasClass(e,"sidebar-pane")){this._panes.push(e);for(var o=e.querySelectorAll(".sidebar-close"),a=0,l=o.length;l>a;a++)this._closeButtons.push(o[a])}},addTo:function(t){var s,i;for(this._map=t,s=this._tabitems.length-1;s>=0;s--){i=this._tabitems[s];var e=i.querySelector("a");e.hasAttribute("href")&&"#"==e.getAttribute("href").slice(0,1)&&L.DomEvent.on(e,"click",L.DomEvent.preventDefault).on(e,"click",this._onClick,i)}for(s=this._closeButtons.length-1;s>=0;s--)i=this._closeButtons[s],L.DomEvent.on(i,"click",this._onCloseClick,this);return this},removeFrom:function(t){console.log("removeFrom() has been deprecated, please use remove() instead as support for this function will be ending soon."),this.remove(t)},remove:function(){var t,s;for(this._map=null,t=this._tabitems.length-1;t>=0;t--)s=this._tabitems[t],L.DomEvent.off(s.querySelector("a"),"click",this._onClick);for(t=this._closeButtons.length-1;t>=0;t--)s=this._closeButtons[t],L.DomEvent.off(s,"click",this._onCloseClick,this);return this},open:function(t){var s,i;for(s=this._panes.length-1;s>=0;s--)i=this._panes[s],i.id==t?L.DomUtil.addClass(i,"active"):L.DomUtil.hasClass(i,"active")&&L.DomUtil.removeClass(i,"active");for(s=this._tabitems.length-1;s>=0;s--)i=this._tabitems[s],i.querySelector("a").hash=="#"+t?L.DomUtil.addClass(i,"active"):L.DomUtil.hasClass(i,"active")&&L.DomUtil.removeClass(i,"active");return this.fire("content",{id:t}),L.DomUtil.hasClass(this._sidebar,"collapsed")&&(this.fire("opening"),L.DomUtil.removeClass(this._sidebar,"collapsed")),this},close:function(){for(var t=this._tabitems.length-1;t>=0;t--){var s=this._tabitems[t];L.DomUtil.hasClass(s,"active")&&L.DomUtil.removeClass(s,"active")}return L.DomUtil.hasClass(this._sidebar,"collapsed")||(this.fire("closing"),L.DomUtil.addClass(this._sidebar,"collapsed")),this},_onClick:function(){L.DomUtil.hasClass(this,"active")?this._sidebar.close():L.DomUtil.hasClass(this,"disabled")||this._sidebar.open(this.querySelector("a").hash.slice(1))},_onCloseClick:function(){this.close()}}),L.control.sidebar=function(t,s){return new L.Control.Sidebar(t,s)};