Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 1 | define(['menu/prefix'], function (prefixClass) { |
2 | return { | ||||
Nils Diewald | 7148c6f | 2015-05-04 15:07:53 +0000 | [diff] [blame] | 3 | |
4 | /** | ||||
5 | * Create prefix object for the hint helper menu. | ||||
6 | */ | ||||
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 7 | create : function (params) { |
Nils Diewald | 7148c6f | 2015-05-04 15:07:53 +0000 | [diff] [blame] | 8 | return Object.create(prefixClass). |
9 | upgradeTo(this)._init(params); | ||||
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 10 | }, |
Nils Diewald | 7148c6f | 2015-05-04 15:07:53 +0000 | [diff] [blame] | 11 | |
12 | /** | ||||
13 | * Override the prefix action. | ||||
14 | */ | ||||
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 15 | onclick : function () { |
16 | var m = this.menu(); | ||||
Akron | 6ed1399 | 2016-05-23 18:06:05 +0200 | [diff] [blame^] | 17 | var value = this.value(); |
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 18 | var h = m.hint(); |
19 | m.hide(); | ||||
20 | |||||
Akron | 6ed1399 | 2016-05-23 18:06:05 +0200 | [diff] [blame^] | 21 | h.inputField().insert(value); |
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 22 | h.active = false; |
23 | } | ||||
24 | }; | ||||
25 | }); |