Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(454)

Side by Side Diff: chrome/browser/resources/print_preview/settings/page_settings.js

Issue 435393005: [PrintPreview] Custom input focus toggles (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review feedback Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 });
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698