/
TabSensitiveTextField.js
47 lines (37 loc) · 1.43 KB
/
TabSensitiveTextField.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// This file is part of AceWiki.
// Copyright 2008-2010, Tobias Kuhn.
//
// AceWiki is free software: you can redistribute it and/or modify it under the terms of the GNU
// Lesser General Public License as published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
//
// AceWiki is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
// even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License along with AceWiki. If
// not, see http://www.gnu.org/licenses/.
if (!Core.get(window, ["Attempto"])) {
Core.set(window, ["Attempto"], {});
}
Attempto.TabSensitiveTextField = Core.extend(Echo.TextField, {
$load : function() {
Echo.ComponentFactory.registerType("Attempto.TabSensitiveTextField", this);
},
componentType : "Attempto.TabSensitiveTextField"
});
Attempto.TabSensitiveTextField.Peer = Core.extend(Echo.Sync.TextField, {
$load : function() {
Echo.Render.registerPeer("Attempto.TabSensitiveTextField", this);
},
$construct : function() {
Echo.Sync.TextField.call(this);
},
clientKeyDown : function(keyEvent) {
var status = Echo.Sync.TextField.prototype.clientKeyDown.call(this, keyEvent);
if (keyEvent.keyCode == 9) {
this.component.doAction();
}
return status;
}
});