equal
deleted
inserted
replaced
10 mincursize = 0.1; |
10 mincursize = 0.1; |
11 |
11 |
12 dispatch(value,oldval, index) { |
12 dispatch(value,oldval, index) { |
13 switch(index) { |
13 switch(index) { |
14 case 0: |
14 case 0: |
15 this.position = value; |
15 this.range = Math.max(1,value); |
16 break; |
16 break; |
17 case 1: |
17 case 1: |
18 this.range = Math.max(1,value); |
18 this.position = value; |
19 break; |
19 break; |
20 case 2: |
20 case 2: |
21 this.size = value; |
21 this.size = value; |
22 break; |
22 break; |
23 } |
23 } |
53 this.bound_drop = this.drop.bind(this); |
53 this.bound_drop = this.drop.bind(this); |
54 } |
54 } |
55 |
55 |
56 apply_position(position){ |
56 apply_position(position){ |
57 this.position = Math.round(Math.max(Math.min(position, this.range - this.size), 0)); |
57 this.position = Math.round(Math.max(Math.min(position, this.range - this.size), 0)); |
58 this.apply_hmi_value(0, this.position); |
58 this.apply_hmi_value(1, this.position); |
59 } |
59 } |
60 |
60 |
61 on_page_click(is_up){ |
61 on_page_click(is_up){ |
62 this.apply_position(is_up ? this.position-this.size |
62 this.apply_position(is_up ? this.position-this.size |
63 : this.position+this.size); |
63 : this.position+this.size); |