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 PageSettings object. This object encapsulates all settings and | 9 * Creates a PageSettings object. This object encapsulates all settings and |
10 * logic related to page selection. | 10 * logic related to page selection. |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 */ | 163 */ |
164 onCustomRadioClick_: function() { | 164 onCustomRadioClick_: function() { |
165 this.customInput_.focus(); | 165 this.customInput_.focus(); |
166 }, | 166 }, |
167 | 167 |
168 /** | 168 /** |
169 * Called when the custom input is blurred. Enables the all radio button if | 169 * Called when the custom input is blurred. Enables the all radio button if |
170 * the custom input is empty. | 170 * the custom input is empty. |
171 * @private | 171 * @private |
172 */ | 172 */ |
173 onCustomInputBlur_: function() { | 173 onCustomInputBlur_: function(event) { |
174 if (this.customInput_.value == '') { | 174 if (this.customInput_.value == '' && |
| 175 event.relatedTarget != this.customRadio_) { |
175 this.allRadio_.checked = true; | 176 this.allRadio_.checked = true; |
176 } | 177 } |
177 }, | 178 }, |
178 | 179 |
179 /** | 180 /** |
180 * Called when the custom input is focused. | 181 * Called when the custom input is focused. |
181 * @private | 182 * @private |
182 */ | 183 */ |
183 onCustomInputFocus_: function() { | 184 onCustomInputFocus_: function() { |
184 this.customRadio_.checked = true; | 185 this.customRadio_.checked = true; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 fadeOutOption(this.getElement()); | 253 fadeOutOption(this.getElement()); |
253 } | 254 } |
254 } | 255 } |
255 }; | 256 }; |
256 | 257 |
257 // Export | 258 // Export |
258 return { | 259 return { |
259 PageSettings: PageSettings | 260 PageSettings: PageSettings |
260 }; | 261 }; |
261 }); | 262 }); |
OLD | NEW |