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 | */ | ||||
Akron | 954c6a5 | 2020-11-10 14:26:29 +0100 | [diff] [blame] | 17 | onclick : function (e) { |
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(); | ||||
Leo Repp | 8e21cbe | 2021-08-18 16:37:52 +0200 | [diff] [blame^] | 21 | |
Akron | 6ed1399 | 2016-05-23 18:06:05 +0200 | [diff] [blame] | 22 | h.inputField().insert(value); |
Akron | 954c6a5 | 2020-11-10 14:26:29 +0100 | [diff] [blame] | 23 | h.active(null); |
24 | m.hide(); | ||||
25 | // h.unshow(); | ||||
26 | e.halt(); | ||||
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 27 | } |
28 | }; | ||||
29 | }); |