commit 5bb3529c0eed9e2668488a12b2f4575e141327e7
parent c06dd16ffac38c77090a5e2f888bf0765496bef3
Author: Dan Stillman <dstillman@zotero.org>
Date: Sat, 1 Nov 2008 13:24:58 +0000
Closes #1200, Keyboard focus should go to note
Diffstat:
1 file changed, 19 insertions(+), 0 deletions(-)
diff --git a/chrome/content/zotero/bindings/styled-textbox.xml b/chrome/content/zotero/bindings/styled-textbox.xml
@@ -35,6 +35,7 @@
<field name="_commandString"/>
<field name="_eventHandler"/>
<field name="_timer"/>
+ <field name="_focus"/>
<constructor><![CDATA[
this.mode = this.getAttribute('mode');
@@ -236,6 +237,20 @@
onset="this.setAttribute('timeout', val); return val;"
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"/>
<method name="_load">
<body>
@@ -263,6 +278,10 @@
if (self._value) {
self.value = self._value;
}
+ if (self._focus) {
+ self._editor.focus();
+ self._focus = false;
+ }
});
if (self._eventHandler) {