Commit c41eed2f1fcb1a39c45b8f1ededf3b1385f0f8d1
1 parent
2c7ac54d
page slider
Showing
1 changed file
with
19 additions
and
4 deletions
controllets/page-slider-controllet/page-slider-controllet.html
@@ -119,6 +119,11 @@ | @@ -119,6 +119,11 @@ | ||
119 | value : "" | 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 | selected : { | 127 | selected : { |
123 | type : Number, | 128 | type : Number, |
124 | value : 0 | 129 | value : 0 |
@@ -206,13 +211,23 @@ | @@ -206,13 +211,23 @@ | ||
206 | return this.prevSelected; | 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 | _onPrevClick : function() { | 224 | _onPrevClick : function() { |
210 | var buttons = document.getElementsByTagName("paper-icon-button"); | 225 | var buttons = document.getElementsByTagName("paper-icon-button"); |
211 | buttons[0].setAttribute("disabled", "true"); | 226 | buttons[0].setAttribute("disabled", "true"); |
212 | buttons[1].setAttribute("disabled", "true"); | 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 | this.prevSelected = this.selected; | 232 | this.prevSelected = this.selected; |
218 | this.selected = this.selected === 0 ? (this.pages-1) : (this.selected - 1); | 233 | this.selected = this.selected === 0 ? (this.pages-1) : (this.selected - 1); |
@@ -223,8 +238,8 @@ | @@ -223,8 +238,8 @@ | ||
223 | buttons[0].setAttribute("disabled", "true"); | 238 | buttons[0].setAttribute("disabled", "true"); |
224 | buttons[1].setAttribute("disabled", "true"); | 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 | this.prevSelected = this.selected; | 244 | this.prevSelected = this.selected; |
230 | this.selected = this.selected === (this.pages-1) ? 0 : (this.selected + 1); | 245 | this.selected = this.selected === (this.pages-1) ? 0 : (this.selected + 1); |