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