Commit c41eed2f1fcb1a39c45b8f1ededf3b1385f0f8d1

Authored by Renato De Donato
1 parent 2c7ac54d

page slider

controllets/page-slider-controllet/page-slider-controllet.html
... ... @@ -119,6 +119,11 @@
119 119 value : ""
120 120 },
121 121  
  122 + prevEntryAnimation : {type : String, value : 'slide-from-left-animation'},
  123 + prevExitAnimation : {type : String, value : 'slide-right-animation'},
  124 + nextEntryAnimation : {type : String, value : 'slide-from-right-animation'},
  125 + nextExitAnimation : {type : String, value : 'slide-left-animation'},
  126 +
122 127 selected : {
123 128 type : Number,
124 129 value : 0
... ... @@ -206,13 +211,23 @@
206 211 return this.prevSelected;
207 212 },
208 213  
  214 + setPrevAnimation : function(entryAnimation, exitAnimation) {
  215 + this.prevEntryAnimation = entryAnimation;
  216 + this.prevExitAnimation = exitAnimation;
  217 + },
  218 +
  219 + setNextAnimation : function(entryAnimation, exitAnimation) {
  220 + this.nextEntryAnimation = entryAnimation;
  221 + this.nextExitAnimation = exitAnimation;
  222 + },
  223 +
209 224 _onPrevClick : function() {
210 225 var buttons = document.getElementsByTagName("paper-icon-button");
211 226 buttons[0].setAttribute("disabled", "true");
212 227 buttons[1].setAttribute("disabled", "true");
213 228  
214   - this.entryAnimation = 'slide-from-left-animation';
215   - this.exitAnimation = 'slide-right-animation';
  229 + this.entryAnimation = this.prevEntryAnimation;
  230 + this.exitAnimation = this.prevExitAnimation;
216 231  
217 232 this.prevSelected = this.selected;
218 233 this.selected = this.selected === 0 ? (this.pages-1) : (this.selected - 1);
... ... @@ -223,8 +238,8 @@
223 238 buttons[0].setAttribute("disabled", "true");
224 239 buttons[1].setAttribute("disabled", "true");
225 240  
226   - this.entryAnimation = 'slide-from-right-animation';
227   - this.exitAnimation = 'slide-left-animation';
  241 + this.entryAnimation = this.nextEntryAnimation;
  242 + this.exitAnimation = this.nextExitAnimation;
228 243  
229 244 this.prevSelected = this.selected;
230 245 this.selected = this.selected === (this.pages-1) ? 0 : (this.selected + 1);
... ...