| 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 CopiesSettings object. | 9 * Creates a CopiesSettings object. |
| 10 * @constructor | 10 * @constructor |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 this.updateButtonsState_.bind(this)); | 154 this.updateButtonsState_.bind(this)); |
| 155 document.addEventListener('printerCapabilitiesUpdated', | 155 document.addEventListener('printerCapabilitiesUpdated', |
| 156 this.onPrinterCapabilitiesUpdated_.bind(this)); | 156 this.onPrinterCapabilitiesUpdated_.bind(this)); |
| 157 }, | 157 }, |
| 158 | 158 |
| 159 /** | 159 /** |
| 160 * Listener triggered when a printerCapabilitiesUpdated event occurs. | 160 * Listener triggered when a printerCapabilitiesUpdated event occurs. |
| 161 * @private | 161 * @private |
| 162 */ | 162 */ |
| 163 onPrinterCapabilitiesUpdated_: function(e) { | 163 onPrinterCapabilitiesUpdated_: function(e) { |
| 164 if (e.printerCapabilities.disableCopiesOption) { | 164 e.printerCapabilities.disableCopiesOption ? |
| 165 fadeOutElement(this.copiesOption_); | 165 fadeOutOption(this.copiesOption_) : |
| 166 $('hr-before-copies').classList.remove('invisible'); | 166 fadeInOption(this.copiesOption_); |
| 167 } else { | 167 |
| 168 fadeInElement(this.copiesOption_); | |
| 169 $('hr-before-copies').classList.add('invisible'); | |
| 170 } | |
| 171 this.updateTwoSidedOption_( | 168 this.updateTwoSidedOption_( |
| 172 e.printerCapabilities.printerDefaultDuplexValue); | 169 e.printerCapabilities.printerDefaultDuplexValue); |
| 173 }, | 170 }, |
| 174 | 171 |
| 175 /** | 172 /** |
| 176 * Listener triggered when |incrementButton_| is clicked. | 173 * Listener triggered when |incrementButton_| is clicked. |
| 177 * @private | 174 * @private |
| 178 */ | 175 */ |
| 179 onIncrementButtonClicked_: function() { | 176 onIncrementButtonClicked_: function() { |
| 180 this.onButtonClicked_(1); | 177 this.onButtonClicked_(1); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 fadeOutElement(this.hint_); | 235 fadeOutElement(this.hint_); |
| 239 } | 236 } |
| 240 this.hint_.setAttribute('aria-hidden', this.isValid()); | 237 this.hint_.setAttribute('aria-hidden', this.isValid()); |
| 241 } | 238 } |
| 242 }; | 239 }; |
| 243 | 240 |
| 244 return { | 241 return { |
| 245 CopiesSettings: CopiesSettings, | 242 CopiesSettings: CopiesSettings, |
| 246 }; | 243 }; |
| 247 }); | 244 }); |
| OLD | NEW |