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

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

Issue 12209086: Page range comparisons should use document size. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 this.printTicketStore_.updatePageRange(this.customInput_.value); 211 this.printTicketStore_.updatePageRange(this.customInput_.value);
212 } 212 }
213 }, 213 },
214 214
215 /** 215 /**
216 * Called when the print ticket changes. Updates the state of the component. 216 * Called when the print ticket changes. Updates the state of the component.
217 * @private 217 * @private
218 */ 218 */
219 onPrintTicketStoreChange_: function() { 219 onPrintTicketStoreChange_: function() {
220 if (this.printTicketStore_.hasPageRangeCapability()) { 220 if (this.printTicketStore_.hasPageRangeCapability()) {
221 var pageRangeStr = this.printTicketStore_.getPageRangeStr(); 221 var pageRangeStr = this.printTicketStore_.getPageRange().getValue();
222 if (pageRangeStr || this.customRadio_.checked) { 222 if (pageRangeStr || this.customRadio_.checked) {
223 if (!document.hasFocus() || 223 if (!document.hasFocus() ||
224 document.activeElement != this.customInput_) { 224 document.activeElement != this.customInput_) {
225 this.customInput_.value = pageRangeStr; 225 this.customInput_.value = pageRangeStr;
226 } 226 }
227 this.customRadio_.checked = true; 227 this.customRadio_.checked = true;
228 this.allRadio_.checked = false; 228 this.allRadio_.checked = false;
229 this.setInvalidStateVisible_( 229 this.setInvalidStateVisible_(
230 !this.printTicketStore_.isPageRangeValid()); 230 !this.printTicketStore_.isPageRangeValid());
231 } else { 231 } else {
232 this.allRadio_.checked = true; 232 this.allRadio_.checked = true;
233 this.customRadio_.checked = false; 233 this.customRadio_.checked = false;
234 this.setInvalidStateVisible_(false); 234 this.setInvalidStateVisible_(false);
235 } 235 }
236 fadeInOption(this.getElement()); 236 fadeInOption(this.getElement());
237 } else { 237 } else {
238 fadeOutOption(this.getElement()); 238 fadeOutOption(this.getElement());
239 } 239 }
240 } 240 }
241 }; 241 };
242 242
243 // Export 243 // Export
244 return { 244 return {
245 PageSettings: PageSettings 245 PageSettings: PageSettings
246 }; 246 };
247 }); 247 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698