| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 * Print options section to control printer advanced options. | 9 * Print options section to control printer advanced options. |
| 10 * @param {!print_preview.ticket_item.VendorItems} ticketItem Ticket item to | 10 * @param {!print_preview.ticket_item.VendorItems} ticketItem Ticket item to |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 53 |
| 54 /** @param {boolean} isEnabled Whether the component is enabled. */ | 54 /** @param {boolean} isEnabled Whether the component is enabled. */ |
| 55 set isEnabled(isEnabled) { | 55 set isEnabled(isEnabled) { |
| 56 this.getButton_().disabled = !isEnabled; | 56 this.getButton_().disabled = !isEnabled; |
| 57 }, | 57 }, |
| 58 | 58 |
| 59 /** @override */ | 59 /** @override */ |
| 60 enterDocument: function() { | 60 enterDocument: function() { |
| 61 print_preview.SettingsSection.prototype.enterDocument.call(this); | 61 print_preview.SettingsSection.prototype.enterDocument.call(this); |
| 62 | 62 |
| 63 this.tracker.add( | 63 this.tracker.add(this.getButton_(), 'click', function() { |
| 64 this.getButton_(), 'click', function() { | 64 cr.dispatchSimpleEvent( |
| 65 cr.dispatchSimpleEvent( | 65 this, AdvancedOptionsSettings.EventType.BUTTON_ACTIVATED); |
| 66 this, AdvancedOptionsSettings.EventType.BUTTON_ACTIVATED); | 66 }.bind(this)); |
| 67 }.bind(this)); | |
| 68 this.tracker.add( | 67 this.tracker.add( |
| 69 this.destinationStore_, | 68 this.destinationStore_, |
| 70 print_preview.DestinationStore.EventType.DESTINATION_SELECT, | 69 print_preview.DestinationStore.EventType.DESTINATION_SELECT, |
| 71 this.onDestinationChanged_.bind(this)); | 70 this.onDestinationChanged_.bind(this)); |
| 72 this.tracker.add( | 71 this.tracker.add( |
| 73 this.destinationStore_, | 72 this.destinationStore_, print_preview.DestinationStore.EventType |
| 74 print_preview.DestinationStore.EventType. | 73 .SELECTED_DESTINATION_CAPABILITIES_READY, |
| 75 SELECTED_DESTINATION_CAPABILITIES_READY, | |
| 76 this.onDestinationChanged_.bind(this)); | 74 this.onDestinationChanged_.bind(this)); |
| 77 }, | 75 }, |
| 78 | 76 |
| 79 /** | 77 /** |
| 80 * @return {HTMLElement} | 78 * @return {HTMLElement} |
| 81 * @private | 79 * @private |
| 82 */ | 80 */ |
| 83 getButton_: function() { | 81 getButton_: function() { |
| 84 return this.getChildElement('.advanced-options-settings-button'); | 82 return this.getChildElement('.advanced-options-settings-button'); |
| 85 }, | 83 }, |
| 86 | 84 |
| 87 /** | 85 /** |
| 88 * Called when the destination selection has changed. Updates UI elements. | 86 * Called when the destination selection has changed. Updates UI elements. |
| 89 * @private | 87 * @private |
| 90 */ | 88 */ |
| 91 onDestinationChanged_: function() { | 89 onDestinationChanged_: function() { |
| 92 this.updateUiStateInternal(); | 90 this.updateUiStateInternal(); |
| 93 } | 91 } |
| 94 }; | 92 }; |
| 95 | 93 |
| 96 // Export | 94 // Export |
| 97 return { | 95 return {AdvancedOptionsSettings: AdvancedOptionsSettings}; |
| 98 AdvancedOptionsSettings: AdvancedOptionsSettings | |
| 99 }; | |
| 100 }); | 96 }); |
| OLD | NEW |