From 16d173e4cbf7dac7e7ebd2d52f5e4c7a3525614d Mon Sep 17 00:00:00 2001 From: Nazar Mokrynskyi Date: Wed, 16 Nov 2016 10:58:04 +0200 Subject: [PATCH] Fix for removing own event listeners during destroying, fixes [#153](https://github.com/nazar-pc/PickMeUp/issues/153) --- bower.json | 2 +- changelog.md | 3 +++ dist/pickmeup.min.js | 14 +++++++------- js/pickmeup.js | 2 +- package.json | 2 +- 5 files changed, 13 insertions(+), 10 deletions(-) diff --git a/bower.json b/bower.json index d18b100..1e3bf25 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name" : "pickmeup", - "version" : "3.0.7", + "version" : "3.0.8", "homepage" : "https://github.com/nazar-pc/PickMeUp", "authors" : [ "Nazar Mokrynskyi " diff --git a/changelog.md b/changelog.md index 2d4ddbf..2654cd9 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,6 @@ +3.0.8 (16 November, 2016) +* Fix for removing own event listeners during destroying, fixes [#153](https://github.com/nazar-pc/PickMeUp/issues/153) + 3.0.7 (11 November, 2016) * Fixed main file ([PR #142](https://github.com/nazar-pc/PickMeUp/pull/142)) * Do not fail with exception when target element to initialize PickMeUp not found, fixes [#148](https://github.com/nazar-pc/PickMeUp/issues/148) diff --git a/dist/pickmeup.min.js b/dist/pickmeup.min.js index 912d528..dafbaef 100644 --- a/dist/pickmeup.min.js +++ b/dist/pickmeup.min.js @@ -4,13 +4,13 @@ @license MIT License, see license.txt */ (function(F,x){"function"===typeof define&&define.amd?define(x):"object"===typeof exports?module.exports=x():F.pickmeup=x()})(this,function(){function F(a,b,c){c=c||[];if(a instanceof Element)b.apply(b,[a].concat(c));else{var d,e;d=a.length;for(e=0;el)){--k;q(G,-1);r=void 0;continue}r=new Date(h);if(!v&&(v=new Date(h),v.setDate(1),q(v, -1),z(v,-1),f&&f>v)){--k;q(G,1);v=void 0;continue}p.querySelector(".pmu-month").textContent=m;var t=function(a){return"range"==c.mode&&a>=(new Date(e[0])).getFullYear()&&a<=(new Date(e[1])).getFullYear()||"multiple"==c.mode&&-1!==e.reduce(function(a,c){a.push((new Date(c)).getFullYear());return a},[]).indexOf(a)||(new Date(e)).getFullYear()==a},u=function(a,b){var d=(new Date(e[0])).getFullYear(),h=(new Date(e[1])).getFullYear(),g=(new Date(e[0])).getMonth(),f=(new Date(e[1])).getMonth();return"range"== -c.mode&&(a>d&&ad&&a==h&&b<=f||a==d&&a=g||a==d&&a==h&&b>=g&&b<=f)||"multiple"==c.mode&&-1!==e.reduce(function(a,c){c=new Date(c);a.push(c.getFullYear()+"-"+c.getMonth());return a},[]).indexOf(a+"-"+b)||(new Date(e)).getFullYear()==a&&(new Date(e)).getMonth()==b};(function(){var a=[],b=h.getFullYear()-6,d=(new Date(c.min)).getFullYear(),e=(new Date(c.max)).getFullYear(),f,k,l;for(l=0;12>l;++l)f=b+l,k=document.createElement("div"),k.textContent=f,k.__pickmeup_year=f,c.min&&f -e?g(k,"pmu-disabled"):t(f)&&g(k,"pmu-selected"),a.push(k);p.appendChild(c.instance_content_template(a,"pmu-years"))})();(function(){var a=[],b=h.getFullYear(),d=(new Date(c.min)).getFullYear(),e=(new Date(c.min)).getMonth(),f=(new Date(c.max)).getFullYear(),k=(new Date(c.max)).getMonth(),l,m;for(l=0;12>l;++l)m=document.createElement("div"),m.textContent=c.locales[c.locale].monthsShort[l],m.__pickmeup_month=l,m.__pickmeup_year=b,c.min&&(bf||l>k&&b>=f)?g(m,"pmu-disabled"): +function n(a,b){return a&&a.classList.contains(b)}function g(a,b){a.classList.add(b)}function t(a,b,c,d){if(-1!==c.indexOf(" ")){c=c.split(" ");var e=c.length,g;for(g=0;gl)){--k;q(G,-1);r=void 0;continue}r=new Date(h);if(!v&&(v=new Date(h), +v.setDate(1),q(v,1),z(v,-1),f&&f>v)){--k;q(G,1);v=void 0;continue}p.querySelector(".pmu-month").textContent=m;var t=function(a){return"range"==c.mode&&a>=(new Date(e[0])).getFullYear()&&a<=(new Date(e[1])).getFullYear()||"multiple"==c.mode&&-1!==e.reduce(function(a,c){a.push((new Date(c)).getFullYear());return a},[]).indexOf(a)||(new Date(e)).getFullYear()==a},u=function(a,b){var d=(new Date(e[0])).getFullYear(),h=(new Date(e[1])).getFullYear(),g=(new Date(e[0])).getMonth(),f=(new Date(e[1])).getMonth(); +return"range"==c.mode&&(a>d&&ad&&a==h&&b<=f||a==d&&a=g||a==d&&a==h&&b>=g&&b<=f)||"multiple"==c.mode&&-1!==e.reduce(function(a,c){c=new Date(c);a.push(c.getFullYear()+"-"+c.getMonth());return a},[]).indexOf(a+"-"+b)||(new Date(e)).getFullYear()==a&&(new Date(e)).getMonth()==b};(function(){var a=[],b=h.getFullYear()-6,d=(new Date(c.min)).getFullYear(),e=(new Date(c.max)).getFullYear(),f,k,l;for(l=0;12>l;++l)f=b+l,k=document.createElement("div"),k.textContent=f,k.__pickmeup_year=f,c.min&& +fe?g(k,"pmu-disabled"):t(f)&&g(k,"pmu-selected"),a.push(k);p.appendChild(c.instance_content_template(a,"pmu-years"))})();(function(){var a=[],b=h.getFullYear(),d=(new Date(c.min)).getFullYear(),e=(new Date(c.min)).getMonth(),f=(new Date(c.max)).getFullYear(),k=(new Date(c.max)).getMonth(),l,m;for(l=0;12>l;++l)m=document.createElement("div"),m.textContent=c.locales[c.locale].monthsShort[l],m.__pickmeup_month=l,m.__pickmeup_year=b,c.min&&(bf||l>k&&b>=f)?g(m,"pmu-disabled"): u(b,l)&&g(m,"pmu-selected"),a.push(m);p.appendChild(c.instance_content_template(a,"pmu-months"))})();(function(){var a=[],b=h.getMonth(),d=A(new Date).valueOf(),e,f,k,l,m;(function(){h.setDate(1);var a=(h.getDay()-c.first_day)%7;z(h,-(a+(0>a?7:0)))})();for(e=0;42>e;++e)f=document.createElement("div"),f.textContent=h.getDate(),f.__pickmeup_day=h.getDate(),f.__pickmeup_month=h.getMonth(),f.__pickmeup_year=h.getFullYear(),b!=h.getMonth()&&g(f,"pmu-not-in-month"),0==h.getDay()?g(f,"pmu-sunday"):6==h.getDay()&& g(f,"pmu-saturday"),k=c.render(new Date(h))||{},l=h.valueOf(),m=c.min&&c.min>h||c.max&&c.max=c.date[0]&&l<=c.date[1])&&g(f,"pmu-selected"),l==d&&g(f,"pmu-today"),k.class_name&&k.class_name.split(" ").forEach(g.bind(f,f)),a.push(f),z(h,1);p.appendChild(c.instance_content_template(a,"pmu-days"))})()}v.setDate(1);r.setDate(1);q(r, 1);z(r,-1);d=b.querySelector(".pmu-prev");b=b.querySelector(".pmu-next");d&&(d.style.visibility=c.min&&c.min>=v?"hidden":"visible");b&&(b.style.visibility=c.max&&c.max<=r?"hidden":"visible");C(a,"fill")}function u(a,b){var c=b.format,d=b.separator,e=b.locales[b.locale];if(a instanceof Date||a instanceof Number)return A(new Date(a));if(!a)return A(new Date);if(a instanceof Array){a=a.slice();for(c=0;c