| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 PrintHeader object. This object encapsulates all the elements | 9 * Creates a PrintHeader object. This object encapsulates all the elements |
| 10 * and logic related to the top part of the left pane in print_preview.html. | 10 * and logic related to the top part of the left pane in print_preview.html. |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 this.onTicketChange_.bind(this)); | 135 this.onTicketChange_.bind(this)); |
| 136 }, | 136 }, |
| 137 | 137 |
| 138 /** | 138 /** |
| 139 * Updates Print Button state. | 139 * Updates Print Button state. |
| 140 * @private | 140 * @private |
| 141 */ | 141 */ |
| 142 updatePrintButtonEnabledState_: function() { | 142 updatePrintButtonEnabledState_: function() { |
| 143 this.getChildElement('button.print').disabled = | 143 this.getChildElement('button.print').disabled = |
| 144 this.destinationStore_.selectedDestination == null || | 144 this.destinationStore_.selectedDestination == null || |
| 145 // TODO(tbarzic): Remove this when print request for extension |
| 146 // destinations is wired up. |
| 147 this.destinationStore_.selectedDestination.isExtension || |
| 145 !this.isEnabled_ || | 148 !this.isEnabled_ || |
| 146 !this.isPrintButtonEnabled_ || | 149 !this.isPrintButtonEnabled_ || |
| 147 !this.printTicketStore_.isTicketValid(); | 150 !this.printTicketStore_.isTicketValid(); |
| 148 }, | 151 }, |
| 149 | 152 |
| 150 /** | 153 /** |
| 151 * Updates the summary element based on the currently selected user options. | 154 * Updates the summary element based on the currently selected user options. |
| 152 * @private | 155 * @private |
| 153 */ | 156 */ |
| 154 updateSummary_: function() { | 157 updateSummary_: function() { |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 this.getChildElement('button.print').focus(); | 269 this.getChildElement('button.print').focus(); |
| 267 } | 270 } |
| 268 } | 271 } |
| 269 }; | 272 }; |
| 270 | 273 |
| 271 // Export | 274 // Export |
| 272 return { | 275 return { |
| 273 PrintHeader: PrintHeader | 276 PrintHeader: PrintHeader |
| 274 }; | 277 }; |
| 275 }); | 278 }); |
| OLD | NEW |