Closes #1200, Keyboard focus should go to note

This commit is contained in:
Dan Stillman 2008-11-01 13:24:58 +00:00
parent c06dd16ffa
commit 5bb3529c0e

View File

@ -35,6 +35,7 @@
<field name="_commandString"/> <field name="_commandString"/>
<field name="_eventHandler"/> <field name="_eventHandler"/>
<field name="_timer"/> <field name="_timer"/>
<field name="_focus"/>
<constructor><![CDATA[ <constructor><![CDATA[
this.mode = this.getAttribute('mode'); this.mode = this.getAttribute('mode');
@ -236,6 +237,20 @@
onset="this.setAttribute('timeout', val); return val;" onset="this.setAttribute('timeout', val); return val;"
onget="return parseInt(this.getAttribute('timeout')) || 0;"/> onget="return parseInt(this.getAttribute('timeout')) || 0;"/>
<method name="focus">
<body>
<![CDATA[
if (this._editor) {
this._editor.focus();
this._focus = false;
}
else {
this._focus = true;
}
]]>
</body>
</method>
<field name="_loaded"/> <field name="_loaded"/>
<method name="_load"> <method name="_load">
<body> <body>
@ -263,6 +278,10 @@
if (self._value) { if (self._value) {
self.value = self._value; self.value = self._value;
} }
if (self._focus) {
self._editor.focus();
self._focus = false;
}
}); });
if (self._eventHandler) { if (self._eventHandler) {