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

Unified Diff: chrome/browser/resources/print_preview/data/ticket_items/scaling.js

Issue 2713033003: Print Preview: Show error message if text is typed in Copies section (Closed)
Patch Set: Use valueAsNumber instead of Number ToFixed Created 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/print_preview/data/ticket_items/scaling.js
diff --git a/chrome/browser/resources/print_preview/data/ticket_items/scaling.js b/chrome/browser/resources/print_preview/data/ticket_items/scaling.js
index c7f3a37fb58fbc24f7c247fa2db982dd3a15bcf1..aa1935973d8cdbe26c9bb5427a4d0d3539afc249 100644
--- a/chrome/browser/resources/print_preview/data/ticket_items/scaling.js
+++ b/chrome/browser/resources/print_preview/data/ticket_items/scaling.js
@@ -26,45 +26,19 @@ cr.define('print_preview.ticket_items', function() {
documentInfo);
};
- /**
- * Maximum scaling percentage
- * @private {number}
- * @const
- */
- Scaling.MAX_VAL = 200;
-
- /**
- * Minimum scaling percentage
- * @private {number}
- * @const
- */
- Scaling.MIN_VAL = 10;
-
Scaling.prototype = {
__proto__: print_preview.ticket_items.TicketItem.prototype,
/** @override */
wouldValueBeValid: function(value) {
- if (/[^\d]+/.test(value)) {
- return false;
- }
- var scaling = parseInt(value, 10);
- return scaling >= Scaling.MIN_VAL && scaling <= Scaling.MAX_VAL;
- },
+ return true;
+ },
/** @override */
isValueEqual: function(value) {
return this.getValueAsNumber() == value;
},
- /**
- * @param {number} The desired scaling percentage.
- * @return {number} Nearest valid scaling percentage
- */
- getNearestValidValue: function(value) {
- return Math.min(Math.max(value, Scaling.MIN_VAL), Scaling.MAX_VAL);
- },
-
/** @override */
isCapabilityAvailable: function() {
// This is not a function of the printer, but should be disabled if we are

Powered by Google App Engine
This is Rietveld 408576698