Bug 679120 - Allow negative numbers for integer prefs in mobile about:config [r=lucasr]
authorMatt Brubeck <mbrubeck@mozilla.com>
Tue, 16 Aug 2011 10:10:10 -0700
changeset 75403 d9ec7a44e2ab399ecc0b7841a338687280cd6a6a
parent 75402 47ae156df73fcd85dc5389c0d8ccd37e25fa20d3
child 75404 250fa13ab0b6f2cb92ade7d3ad35ffb1616c64d0
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewerslucasr
bugs679120
milestone8.0a1
Bug 679120 - Allow negative numbers for integer prefs in mobile about:config [r=lucasr]
mobile/chrome/content/config.js
--- a/mobile/chrome/content/config.js
+++ b/mobile/chrome/content/config.js
@@ -86,16 +86,17 @@ var ViewConfig = {
     let buttons = document.getElementById("editor-buttons-add");
     buttons.setAttribute("hidden", "true");
 
     let shouldFocus = false;
     let setting = document.getElementById("editor-setting");
     switch (aType) {
       case Ci.nsIPrefBranch.PREF_INT:
         setting.setAttribute("type", "integer");
+        setting.setAttribute("min", -Infinity);
         break;
       case Ci.nsIPrefBranch.PREF_BOOL:
         setting.setAttribute("type", "bool");
         break;
       case Ci.nsIPrefBranch.PREF_STRING:
         setting.setAttribute("type", "string");
         break;
     }
@@ -153,16 +154,17 @@ var ViewConfig = {
     switch (pref.type) {
       case Ci.nsIPrefBranch.PREF_BOOL:
         setting.setAttribute("type", "bool");
         break;
 
       case Ci.nsIPrefBranch.PREF_INT:
         setting.setAttribute("type", "integer");
         setting.setAttribute("increment", this.getIncrementForValue(pref.value));
+        setting.setAttribute("min", -Infinity);
         shouldFocus = true;
         break;
 
       case Ci.nsIPrefBranch.PREF_STRING:
         setting.setAttribute("type", "string");
         shouldFocus = true;
         break;
     }