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
|
define.class("$ui/view", function() {
this.bgcolor = 'transparent';
this.attributes = {
value:Config({type:String, value:'', persist:true}),
activekeys:Config({type:Array, value:[], persist:true})
};
this.press = function(key) {
if (this.activekeys.indexOf(key) < 0) {
var active = this.activekeys.slice();
active.unshift(key);
this.activekeys = active;
}
this.value = key;
};
this.unpress = function(key) {
if (this.activekeys.indexOf(key) >= 0) {
var active = this.activekeys.slice();
active.splice(active.indexOf(key), 1);
this.activekeys = active;
}
this.value = this.activekeys[0];
};
this.onactivekeys = function() {
}
this.onvalue = function() {
}
});
|