Index: chrome/browser/resources/print_preview/print_preview_utils.js |
diff --git a/chrome/browser/resources/print_preview/print_preview_utils.js b/chrome/browser/resources/print_preview/print_preview_utils.js |
index c761650726ca5bbda8a2f0cc251d56fcdde84297..bee66b693ec9c771ccb754849893ec4c824c36d1 100644 |
--- a/chrome/browser/resources/print_preview/print_preview_utils.js |
+++ b/chrome/browser/resources/print_preview/print_preview_utils.js |
@@ -251,17 +251,19 @@ function convertPointsToMillimeters(value) { |
} |
/** |
- * Parses |numberFormat| and extracts the symbols used for the thousands point |
- * and decimal point. |
- * @param {string} numberFormat The formatted version of the number 12345678. |
- * @return {!Array.<string>} The extracted symbols in the order |
- * [thousandsSymbol, decimalSymbol]]. For example |
- * parseNumberFormat("123,456.78") returns [",", "."]. |
+ * Shows or hides an element. |
+ * @param {Element} element Element to show or hide. |
+ * @param {boolean} isVisible Whether the element should be visible or not. |
*/ |
-function parseNumberFormat(numberFormat) { |
- if (!numberFormat) |
- numberFormat = ''; |
- var regex = /^(\d+)(\W{0,1})(\d+)(\W{0,1})(\d+)$/; |
- var matches = numberFormat.match(regex) || ['', '', ',', '', '.']; |
- return [matches[2], matches[4]]; |
+function setIsVisible(element, isVisible) { |
+ element.style.display = isVisible ? '' : 'none'; |
+} |
+ |
+/** |
+ * @param {Array.<object>} array Array to check for item. |
+ * @param {object} item Item to look for in array. |
+ * @return {boolean} Whether the item is in the array. |
+ */ |
+function arrayContains(array, item) { |
+ return array.indexOf(item) != -1; |
} |