зеркало из https://github.com/mozilla/gecko-dev.git
Bug 508216: Error : 'val is null' the first time the preferences panel is showed [r=mark.finkle]
This commit is contained in:
Родитель
59da8d79ba
Коммит
dcac979084
|
@ -45,8 +45,11 @@
|
||||||
<binding id="richpref-base">
|
<binding id="richpref-base">
|
||||||
<implementation>
|
<implementation>
|
||||||
<constructor>
|
<constructor>
|
||||||
this.pref._setValue(this.pref.valueFromPreferences, false);
|
let prefValue = this.pref.valueFromPreferences;
|
||||||
|
if (prefValue != null) {
|
||||||
|
this.pref._setValue(prefValue, false);
|
||||||
this.prefChanged();
|
this.prefChanged();
|
||||||
|
}
|
||||||
</constructor>
|
</constructor>
|
||||||
|
|
||||||
<method name="fireEvent">
|
<method name="fireEvent">
|
||||||
|
@ -54,15 +57,15 @@
|
||||||
<parameter name="funcStr"/>
|
<parameter name="funcStr"/>
|
||||||
<body>
|
<body>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
var body = funcStr || this.getAttribute(eventName);
|
let body = funcStr || this.getAttribute(eventName);
|
||||||
if (!body)
|
if (!body)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var event = document.createEvent("Events");
|
let event = document.createEvent("Events");
|
||||||
event.initEvent(eventName, true, true);
|
event.initEvent(eventName, true, true);
|
||||||
var f = new Function("event", body);
|
let f = new Function("event", body);
|
||||||
f.call(this, event);
|
f.call(this, event);
|
||||||
}
|
}
|
||||||
catch (e)
|
catch (e)
|
||||||
|
|
Загрузка…
Ссылка в новой задаче