diff --git a/docs/assets/js/glider.js b/docs/assets/js/glider.js index a890058..7276261 100644 --- a/docs/assets/js/glider.js +++ b/docs/assets/js/glider.js @@ -5,7 +5,7 @@ \___//_//_/ \_,_/ \__//_/ (_)__/ //___/ |___/ - Version: 1.5.2 + Version: 1.5.3 Author: Nick Piscitelli (pickykneee) Website: https://nickpiscitelli.com Documentation: http://nickpiscitelli.github.io/Glider.js @@ -343,7 +343,7 @@ if (_.slides.length){ _.track.removeChild(_.slides[index]); - _.init(true, true); + _.refresh(true); _.emit('remove') } } @@ -352,7 +352,7 @@ var _ = this _.track.appendChild(ele); - _.init(true, true); + _.refresh(true); _.emit('add') } @@ -377,6 +377,7 @@ gliderPrototype.setOption = function(opt){ this.opt = Object.assign({}, this.opt, opt) + this._opt = Object.assign({}, this._opt, opt); } gliderPrototype.destroy = function(){ @@ -411,4 +412,4 @@ eventHandler(k, args[k]); }); } -})); \ No newline at end of file +})); diff --git a/glider.js b/glider.js index 081eb85..7276261 100644 --- a/glider.js +++ b/glider.js @@ -5,7 +5,7 @@ \___//_//_/ \_,_/ \__//_/ (_)__/ //___/ |___/ - Version: 1.5.2 + Version: 1.5.3 Author: Nick Piscitelli (pickykneee) Website: https://nickpiscitelli.com Documentation: http://nickpiscitelli.github.io/Glider.js @@ -343,7 +343,7 @@ if (_.slides.length){ _.track.removeChild(_.slides[index]); - _.init(true, true); + _.refresh(true); _.emit('remove') } } @@ -352,7 +352,7 @@ var _ = this _.track.appendChild(ele); - _.init(true, true); + _.refresh(true); _.emit('add') } diff --git a/glider.min.js b/glider.min.js index 88db14b..bf5f64a 100644 --- a/glider.min.js +++ b/glider.min.js @@ -23,6 +23,6 @@ a.page=Math.round(a.ele.scrollLeft/a.containerWidth);var d=a.slide+Math.floor(Ma f.forEach(function(a){/^left|right/.test(a)&&f.remove(a)});f.toggle("active",a.slide===c);d==c||e&&e==c?f.add("center"):(f.remove("center"),f.add([c=g&&m<=h;f.toggle("visible",g);g!=l&&a.emit("slide-"+(g?"visible":"hidden"),{slide:c})});a.dots&&[].forEach.call(a.dots.children,function(b,c){b.classList.toggle("active",a.page===c)});b&&a.opt.scrollLock&&(clearTimeout(a.scrollLock),a.scrollLock=setTimeout(function(){clearTimeout(a.scrollLock); a.ele.scrollLeft/a.itemWidth%1&&a.scrollItem(a.round(a.ele.scrollLeft/a.itemWidth))},a.opt.scrollLockDelay||250))};e.scrollItem=function(b,a,c){c&&c.preventDefault();var d=this,e=b;d.aIndex++;!0===a?b*=d.containerWidth:("string"===typeof b&&(c="prev"===b,b=d.opt.slidesToScroll%1||d.opt.slidesToShow%1?d.round(d.ele.scrollLeft/d.itemWidth):d.slide,b=c?b-d.opt.slidesToScroll:b+d.opt.slidesToScroll),b=Math.max(Math.min(b,d.slides.length),0),d.slide=b,b*=d.itemWidth);d.scrollTo(b,d.opt.duration*Math.abs(d.ele.scrollLeft- b),function(){d.updateControls();d.emit("animated",{value:e,type:"string"===typeof e?"arrow":a?"dot":"slide"})});return!1};e.settingsBreakpoint=function(){var b=this._opt.responsive;if(b)for(var a=0;ac.breakpoint)return this.opt=Object.assign({},this._opt,c.settings),!0}this.opt=Object.assign({},this._opt);return!1};e.scrollTo=function(b,a,c){var d=this,e=(new Date).getTime(),h=d.aIndex,g=function(){var f=(new Date).getTime()-e;d.ele.scrollLeft+=(b-d.ele.scrollLeft)* -d.opt.easing(0,f,0,1,a);f