Bug 594751 - Error: nameField is null [about:config] [r=mfinkle]

This commit is contained in:
Vivien Nicolas 2010-09-10 14:44:56 +02:00
Родитель c0398da415
Коммит 4946948a49
2 изменённых файлов: 11 добавлений и 9 удалений

Просмотреть файл

@ -15,7 +15,7 @@
*
* The Initial Developer of the Original Code is
* Mozilla Corporation.
* Portions created by the Initial Developer are Copyright (C) 2008
* Portions created by the Initial Developer are Copyright (C) 2010
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
@ -85,8 +85,6 @@ var ViewConfig = {
open: function open(aType) {
let buttons = document.getElementById("editor-buttons-add");
buttons.setAttribute("hidden", "true");
let nameField = document.getElementById("editor-name");
nameField.value = "";
let shouldFocus = false;
let setting = document.getElementById("editor-setting");
@ -108,6 +106,9 @@ var ViewConfig = {
setting.input.value = "";
document.getElementById("editor-container").appendChild(this._editor);
let nameField = document.getElementById("editor-name");
nameField.value = "";
this._editor.setAttribute("hidden", "false");
this._currentItem = null;
nameField.focus();
@ -119,13 +120,14 @@ var ViewConfig = {
buttons.setAttribute("hidden", "false");
if (aValid) {
let name = document.getElementById("editor-name").value;
let name = document.getElementById("editor-name").inputField.value;
if (name != "") {
let setting = document.getElementById("editor-setting");
setting.setAttribute("pref", name);
setting.valueToPreference();
}
}
document.getElementById("editor-container").appendChild(this._editor);
},
@ -397,7 +399,7 @@ var Utils = {
},
_generateRegexp: function _generateRegexp(aValue) {
if (aValue.charAt(0) == '/') {
if (aValue.charAt(0) == "/") {
try {
let rv = aValue.match(/^\/(.*)\/(i?)$/);
return RegExp(rv[1], rv[2]);

Просмотреть файл

@ -17,7 +17,7 @@
-
- The Initial Developer of the Original Code is
- Mozilla Corporation.
- Portions created by the Initial Developer are Copyright (C) 2008
- Portions created by the Initial Developer are Copyright (C) 2010
- the Initial Developer. All Rights Reserved.
-
- Contributor(s):
@ -69,9 +69,9 @@
<label value="&newpref.label;" flex="1"/>
<spacer flex="1" />
<hbox id="editor-buttons-add">
<button label="&integer.label;" oncommand="ViewConfig.open(Components.interfaces.nsIPrefBranch.PREF_INT)"/>
<button label="&boolean.label;" oncommand="ViewConfig.open(Components.interfaces.nsIPrefBranch.PREF_BOOL)"/>
<button label="&string.label;" oncommand="ViewConfig.open(Components.interfaces.nsIPrefBranch.PREF_STRING)"/>
<button label="&integer.label;" oncommand="ViewConfig.open(Ci.nsIPrefBranch.PREF_INT)"/>
<button label="&boolean.label;" oncommand="ViewConfig.open(Ci.nsIPrefBranch.PREF_BOOL)"/>
<button label="&string.label;" oncommand="ViewConfig.open(Ci.nsIPrefBranch.PREF_STRING)"/>
</hbox>
</hbox>