OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 cr.define('print_preview', function() { | 5 cr.define('print_preview', function() { |
6 'use strict'; | 6 'use strict'; |
7 | 7 |
8 /** | 8 /** |
9 * Creates a PageSettings object. This object encapsulates all settings and | 9 * Creates a PageSettings object. This object encapsulates all settings and |
10 * logic related to page selection. | 10 * logic related to page selection. |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 return false; | 230 return false; |
231 }, | 231 }, |
232 | 232 |
233 /** | 233 /** |
234 * Validates the selected pages and updates the hint accordingly. | 234 * Validates the selected pages and updates the hint accordingly. |
235 * @private | 235 * @private |
236 */ | 236 */ |
237 validateSelectedPages_: function() { | 237 validateSelectedPages_: function() { |
238 if (this.isPageSelectionValid()) { | 238 if (this.isPageSelectionValid()) { |
239 this.selectedPagesTextfield.classList.remove('invalid'); | 239 this.selectedPagesTextfield.classList.remove('invalid'); |
240 fadeOutElement(this.selectedPagesHint); | 240 fadeOutElement(this.selectedPagesHint_); |
241 this.selectedPagesHint.setAttribute('aria-hidden', 'true'); | 241 this.selectedPagesHint.setAttribute('aria-hidden', 'true'); |
242 } else { | 242 } else { |
243 this.selectedPagesTextfield.classList.add('invalid'); | 243 this.selectedPagesTextfield.classList.add('invalid'); |
244 this.selectedPagesHint.classList.remove('suggestion'); | 244 this.selectedPagesHint.classList.remove('suggestion'); |
245 this.selectedPagesHint.setAttribute('aria-hidden', 'false'); | 245 this.selectedPagesHint.setAttribute('aria-hidden', 'false'); |
246 this.selectedPagesHint.innerHTML = | 246 this.selectedPagesHint.innerHTML = |
247 localStrings.getStringF('pageRangeInstruction', | 247 localStrings.getStringF('pageRangeInstruction', |
248 localStrings.getString( | 248 localStrings.getString( |
249 'examplePageRangeText')); | 249 'examplePageRangeText')); |
250 fadeInElement(this.selectedPagesHint); | 250 fadeInElement(this.selectedPagesHint); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 this.addTimerToSelectedPagesTextfield_.bind(this); | 357 this.addTimerToSelectedPagesTextfield_.bind(this); |
358 this.selectedPagesTextfield.onblur = | 358 this.selectedPagesTextfield.onblur = |
359 this.onSelectedPagesTextfieldBlur_.bind(this); | 359 this.onSelectedPagesTextfieldBlur_.bind(this); |
360 } | 360 } |
361 }; | 361 }; |
362 | 362 |
363 return { | 363 return { |
364 PageSettings: PageSettings, | 364 PageSettings: PageSettings, |
365 }; | 365 }; |
366 }); | 366 }); |
OLD | NEW |