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 * Component that renders the copies settings UI. | 9 * Component that renders the copies settings UI. |
10 * @param {!print_preview.ticket_items.Copies} copiesTicketItem Used to read | 10 * @param {!print_preview.ticket_items.Copies} copiesTicketItem Used to read |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 this.inputField_.disabled = !isEnabled; | 78 this.inputField_.disabled = !isEnabled; |
79 this.getChildElement('input.collate').disabled = !isEnabled; | 79 this.getChildElement('input.collate').disabled = !isEnabled; |
80 this.isEnabled_ = isEnabled; | 80 this.isEnabled_ = isEnabled; |
81 if (isEnabled) { | 81 if (isEnabled) { |
82 this.updateState_(); | 82 this.updateState_(); |
83 } | 83 } |
84 }, | 84 }, |
85 | 85 |
86 /** @override */ | 86 /** @override */ |
87 enterDocument: function() { | 87 enterDocument: function() { |
88 this.inputField_ = assert(this.getChildElement('input.user-value')); | 88 this.inputField_ = this.getChildElement('input.user-value'); |
89 print_preview.SettingsSection.prototype.enterDocument.call(this); | 89 print_preview.SettingsSection.prototype.enterDocument.call(this); |
90 this.tracker.add( | 90 this.tracker.add( |
91 this.inputField_, | 91 this.inputField_, |
92 'keydown', | 92 'keydown', |
93 this.onTextfieldKeyDown_.bind(this)); | 93 this.onTextfieldKeyDown_.bind(this)); |
94 this.tracker.add( | 94 this.tracker.add( |
95 this.inputField_, | 95 this.inputField_, |
96 'input', | 96 'input', |
97 this.onTextfieldInput_.bind(this)); | 97 this.onTextfieldInput_.bind(this)); |
98 this.tracker.add( | 98 this.tracker.add( |
99 this.inputField_, | 99 this.inputField_, |
100 'blur', | 100 'blur', |
101 this.onTextfieldBlur_.bind(this)); | 101 this.onTextfieldBlur_.bind(this)); |
102 this.tracker.add( | 102 this.tracker.add( |
103 assert(this.getChildElement('input.collate')), | 103 this.getChildElement('input.collate'), |
104 'click', | 104 'click', |
105 this.onCollateCheckboxClick_.bind(this)); | 105 this.onCollateCheckboxClick_.bind(this)); |
106 this.tracker.add( | 106 this.tracker.add( |
107 this.copiesTicketItem_, | 107 this.copiesTicketItem_, |
108 print_preview.ticket_items.TicketItem.EventType.CHANGE, | 108 print_preview.ticket_items.TicketItem.EventType.CHANGE, |
109 this.updateState_.bind(this)); | 109 this.updateState_.bind(this)); |
110 this.tracker.add( | 110 this.tracker.add( |
111 this.collateTicketItem_, | 111 this.collateTicketItem_, |
112 print_preview.ticket_items.TicketItem.EventType.CHANGE, | 112 print_preview.ticket_items.TicketItem.EventType.CHANGE, |
113 this.updateState_.bind(this)); | 113 this.updateState_.bind(this)); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 this.collateTicketItem_.updateValue( | 210 this.collateTicketItem_.updateValue( |
211 this.getChildElement('input.collate').checked); | 211 this.getChildElement('input.collate').checked); |
212 } | 212 } |
213 }; | 213 }; |
214 | 214 |
215 // Export | 215 // Export |
216 return { | 216 return { |
217 CopiesSettings: CopiesSettings | 217 CopiesSettings: CopiesSettings |
218 }; | 218 }; |
219 }); | 219 }); |
OLD | NEW |