Commit 8e65d84e561d457600a9ef5fbdc6e9de2e3230b6

Authored by Renato De Donato
1 parent 7c722227

page-slider buttons bug fix

controllets/page-slider-controllet/page-slider-controllet.html
... ... @@ -83,8 +83,8 @@
83 83 </style>
84 84  
85 85 <div class="header">
86   - <paper-icon-button class="chevron-left" on-click="_onPrevClick" icon="arrow-back" title="back"></paper-icon-button>
87   - <paper-icon-button class="chevron-right" on-click="_onNextClick" icon="arrow-forward" title="forward"></paper-icon-button>
  86 + <paper-icon-button id="slider_chevron_left" class="chevron-left" on-click="_onPrevClick" icon="arrow-back"></paper-icon-button>
  87 + <paper-icon-button id="slider_chevron_right" class="chevron-right" on-click="_onNextClick" icon="arrow-forward"></paper-icon-button>
88 88  
89 89 <div class="box">
90 90 <div class="avatar">[[avatar]]</div>
... ... @@ -159,9 +159,8 @@
159 159 attached : function() {
160 160 this.fire('page-slider-controllet_selected', {selected : this.selected});
161 161  
162   - var buttons = document.getElementsByTagName("paper-icon-button");
163   - buttons[0].setAttribute("title", ln["back_" + ln["localization"]]);
164   - buttons[1].setAttribute("title", ln["forward_" + ln["localization"]]);
  162 + this.$.slider_chevron_left.setAttribute("title", ln["back_" + ln["localization"]]);
  163 + this.$.slider_chevron_right.setAttribute("title", ln["forward_" + ln["localization"]]);
165 164 },
166 165  
167 166 setTitle : function(title, subtitle) {
... ... @@ -174,37 +173,31 @@
174 173 },
175 174  
176 175 chevronLeft : function(flag) {
177   - var buttons = document.getElementsByTagName("paper-icon-button");
178   -
179 176 if(flag == "invisible") {
180   - buttons[0].style.visibility = "hidden";
181   -// buttons[0].style.width = "0px";
  177 + this.$.slider_chevron_left.style.visibility = "hidden";
182 178 return;
183 179 }
184 180 else
185   - buttons[0].style.visibility = "visible";
186   -// buttons[0].style.width = "64px";
  181 + this.$.slider_chevron_left.style.visibility = "visible";
187 182  
188 183 if(flag)
189   - buttons[0].removeAttribute("disabled");
  184 + this.$.slider_chevron_left.removeAttribute("disabled");
190 185 else
191   - buttons[0].setAttribute("disabled", "true");
  186 + this.$.slider_chevron_left.setAttribute("disabled", "true");
192 187 },
193 188  
194 189 chevronRight : function(flag) {
195   - var buttons = document.getElementsByTagName("paper-icon-button");
196   -
197 190 if(flag == "invisible") {
198   - buttons[1].style.visibility = "hidden";
  191 + this.$.slider_chevron_right.style.visibility = "hidden";
199 192 return;
200 193 }
201 194 else
202   - buttons[1].style.visibility = "visible";
  195 + this.$.slider_chevron_right.style.visibility = "visible";
203 196  
204 197 if(flag)
205   - buttons[1].removeAttribute("disabled");
  198 + this.$.slider_chevron_right.removeAttribute("disabled");
206 199 else
207   - buttons[1].setAttribute("disabled", "true");
  200 + this.$.slider_chevron_right.setAttribute("disabled", "true");
208 201 },
209 202  
210 203 getPrevSelected : function() {
... ... @@ -222,9 +215,8 @@
222 215 },
223 216  
224 217 _onPrevClick : function() {
225   - var buttons = document.getElementsByTagName("paper-icon-button");
226   - buttons[0].setAttribute("disabled", "true");
227   - buttons[1].setAttribute("disabled", "true");
  218 + this.$.slider_chevron_left.setAttribute("disabled", "true");
  219 + this.$.slider_chevron_right.setAttribute("disabled", "true");
228 220  
229 221 this.entryAnimation = this.prevEntryAnimation;
230 222 this.exitAnimation = this.prevExitAnimation;
... ... @@ -234,9 +226,8 @@
234 226 },
235 227  
236 228 _onNextClick : function() {
237   - var buttons = document.getElementsByTagName("paper-icon-button");
238   - buttons[0].setAttribute("disabled", "true");
239   - buttons[1].setAttribute("disabled", "true");
  229 + this.$.slider_chevron_left.setAttribute("disabled", "true");
  230 + this.$.slider_chevron_right.setAttribute("disabled", "true");
240 231  
241 232 this.entryAnimation = this.nextEntryAnimation;
242 233 this.exitAnimation = this.nextExitAnimation;
... ... @@ -246,9 +237,8 @@
246 237 },
247 238  
248 239 _onNeonAnimationFinish: function() {
249   - var buttons = document.getElementsByTagName("paper-icon-button");
250   - buttons[0].removeAttribute("disabled");
251   - buttons[1].removeAttribute("disabled");
  240 + this.$.slider_chevron_left.removeAttribute("disabled");
  241 + this.$.slider_chevron_right.removeAttribute("disabled");
252 242  
253 243 this.avatar = this.selected+1;
254 244  
... ...