зеркало из https://github.com/mozilla/pjs.git
Bug 312867 - Implement textbox.reset(), expose input's editor, r+sr=neil, r=gavin
This commit is contained in:
Родитель
bae24bb77b
Коммит
4e4ffb5fbc
|
@ -47,6 +47,8 @@
|
|||
|
||||
<property name="value" onset="this.inputField.value = val; return val;"
|
||||
onget="return this.inputField.value;"/>
|
||||
<property name="defaultValue" onset="this.inputField.defaultValue = val; return val;"
|
||||
onget="return this.inputField.defaultValue;"/>
|
||||
<property name="type" onset="this.inputField.type = val; return val;"
|
||||
onget="return this.inputField.type;"/>
|
||||
<property name="maxLength" onset="this.inputField.maxLength = val; return val;"
|
||||
|
@ -77,6 +79,18 @@
|
|||
]]></getter>
|
||||
</property>
|
||||
|
||||
<method name="reset">
|
||||
<body><![CDATA[
|
||||
this.value = this.defaultValue;
|
||||
try {
|
||||
this.editor.transactionManager.clear();
|
||||
return true;
|
||||
}
|
||||
catch(e) {}
|
||||
return false;
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="select">
|
||||
<body>
|
||||
this.inputField.select();
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
|
||||
<property name="value" onset="this.inputField.value = val; return val;"
|
||||
onget="return this.inputField.value;"/>
|
||||
<property name="defaultValue" onset="this.inputField.defaultValue = val; return val;"
|
||||
onget="return this.inputField.defaultValue;"/>
|
||||
<property name="type" onset="this.inputField.type = val; return val;"
|
||||
onget="return this.inputField.type;"/>
|
||||
<property name="maxLength" onset="this.inputField.maxLength = val; return val;"
|
||||
|
@ -77,6 +79,18 @@
|
|||
]]></getter>
|
||||
</property>
|
||||
|
||||
<method name="reset">
|
||||
<body><![CDATA[
|
||||
this.value = this.defaultValue;
|
||||
try {
|
||||
this.editor.transactionManager.clear();
|
||||
return true;
|
||||
}
|
||||
catch(e) {}
|
||||
return false;
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
<method name="select">
|
||||
<body>
|
||||
this.inputField.select();
|
||||
|
|
Загрузка…
Ссылка в новой задаче