Commit 3f45df66 by Иван Кубота

fix

parent 6f7ddfa6
...@@ -110,7 +110,7 @@ const CardSlider = (function(){ ...@@ -110,7 +110,7 @@ const CardSlider = (function(){
this.leftButtonDisabled.set(firstItem===0); this.leftButtonDisabled.set(firstItem===0);
this.rightButtonDisabled.set(firstItem+this.world.fullCardsCount>=this.items.length); this.rightButtonDisabled.set(firstItem+this.world.fullCardsCount>=this.items.length);
if(this.cfg.setOuterHeight){ if(this.cfg.setOuterHeight){
this.scroller.style.height = ( this.hash[ firstItem ].dom.clientHeight + 40 ) + 'px'; this.scroller.style.height = ( this.hash[ firstItem ].dom.clientHeight + 60 ) + 'px';
} }
//console.log(this.leftButtonDisabled.get(), this.rightButtonDisabled.get()) //console.log(this.leftButtonDisabled.get(), this.rightButtonDisabled.get())
...@@ -190,8 +190,14 @@ const CardSlider = (function(){ ...@@ -190,8 +190,14 @@ const CardSlider = (function(){
}, },
setItems: function(items) { setItems: function(items) {
this.items = items; this.items = items;
var hash = this.hash;
for(var i in hash){
if(hash[i].inDOM)
hash[i].dom.parentNode.removeChild(hash[i].dom);
}
this.hash = {}; this.hash = {};
this.last = false; this.last = false;
this.update(); this.update();
}, },
save: function() { save: function() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment