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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
44 * @private | 44 * @private |
45 */ | 45 */ |
46 this.isEnabled_ = true; | 46 this.isEnabled_ = true; |
47 | 47 |
48 /** | 48 /** |
49 * The element for the user input value. | 49 * The element for the user input value. |
50 * @type {HTMLElement} | 50 * @type {HTMLElement} |
51 * @private | 51 * @private |
52 */ | 52 */ |
53 this.inputField_ = null; | 53 this.inputField_ = null; |
54 }; | 54 } |
55 | 55 |
56 /** | 56 /** |
57 * Delay in milliseconds before processing the textfield. | 57 * Delay in milliseconds before processing the textfield. |
58 * @type {number} | 58 * @type {number} |
59 * @private | 59 * @private |
60 */ | 60 */ |
61 CopiesSettings.TEXTFIELD_DELAY_MS_ = 250; | 61 CopiesSettings.TEXTFIELD_DELAY_MS_ = 250; |
62 | 62 |
63 CopiesSettings.prototype = { | 63 CopiesSettings.prototype = { |
64 __proto__: print_preview.SettingsSection.prototype, | 64 __proto__: print_preview.SettingsSection.prototype, |
(...skipping 13 matching lines...) Expand all 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_ = this.getChildElement('input.user-value'); | 88 this.inputField_ = this.getChildElement('input.user-value'); |
dpapad
2017/05/04 01:20:04
Nit: Maybe
this.inputField_ = assert(this.getChild
rbpotter
2017/05/04 01:43:07
Done.
| |
89 print_preview.SettingsSection.prototype.enterDocument.call(this); | 89 print_preview.SettingsSection.prototype.enterDocument.call(this); |
90 var inputField = assert(this.inputField_); | |
90 this.tracker.add( | 91 this.tracker.add( |
91 this.inputField_, | 92 inputField, |
92 'keydown', | 93 'keydown', |
93 this.onTextfieldKeyDown_.bind(this)); | 94 this.onTextfieldKeyDown_.bind(this)); |
94 this.tracker.add( | 95 this.tracker.add( |
95 this.inputField_, | 96 inputField, |
96 'input', | 97 'input', |
97 this.onTextfieldInput_.bind(this)); | 98 this.onTextfieldInput_.bind(this)); |
98 this.tracker.add( | 99 this.tracker.add( |
99 this.inputField_, | 100 inputField, |
100 'blur', | 101 'blur', |
101 this.onTextfieldBlur_.bind(this)); | 102 this.onTextfieldBlur_.bind(this)); |
102 this.tracker.add( | 103 this.tracker.add( |
103 this.getChildElement('input.collate'), | 104 assert(this.getChildElement('input.collate')), |
104 'click', | 105 'click', |
105 this.onCollateCheckboxClick_.bind(this)); | 106 this.onCollateCheckboxClick_.bind(this)); |
106 this.tracker.add( | 107 this.tracker.add( |
107 this.copiesTicketItem_, | 108 this.copiesTicketItem_, |
108 print_preview.ticket_items.TicketItem.EventType.CHANGE, | 109 print_preview.ticket_items.TicketItem.EventType.CHANGE, |
109 this.updateState_.bind(this)); | 110 this.updateState_.bind(this)); |
110 this.tracker.add( | 111 this.tracker.add( |
111 this.collateTicketItem_, | 112 this.collateTicketItem_, |
112 print_preview.ticket_items.TicketItem.EventType.CHANGE, | 113 print_preview.ticket_items.TicketItem.EventType.CHANGE, |
113 this.updateState_.bind(this)); | 114 this.updateState_.bind(this)); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
210 this.collateTicketItem_.updateValue( | 211 this.collateTicketItem_.updateValue( |
211 this.getChildElement('input.collate').checked); | 212 this.getChildElement('input.collate').checked); |
212 } | 213 } |
213 }; | 214 }; |
214 | 215 |
215 // Export | 216 // Export |
216 return { | 217 return { |
217 CopiesSettings: CopiesSettings | 218 CopiesSettings: CopiesSettings |
218 }; | 219 }; |
219 }); | 220 }); |
OLD | NEW |