Nils Diewald | 4c22125 | 2015-04-21 20:19:25 +0000 | [diff] [blame^] | 1 | /** |
| 2 | * Menu showing all key fields. |
| 3 | */ |
Nils Diewald | 1fcb2ad | 2015-04-20 19:19:18 +0000 | [diff] [blame] | 4 | define(['menu', 'vc/item'], function (menuClass, itemClass) { |
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 5 | return { |
| 6 | create : function (params) { |
| 7 | return Object.create(menuClass) |
| 8 | .upgradeTo(this) |
| 9 | ._init(itemClass, undefined, params) |
Nils Diewald | 1fcb2ad | 2015-04-20 19:19:18 +0000 | [diff] [blame] | 10 | }, |
Nils Diewald | 4c22125 | 2015-04-21 20:19:25 +0000 | [diff] [blame^] | 11 | |
| 12 | /** |
| 13 | * Register callback for click event. |
| 14 | */ |
Nils Diewald | 1fcb2ad | 2015-04-20 19:19:18 +0000 | [diff] [blame] | 15 | released : function (cb) { |
| 16 | this._cb = cb; |
| 17 | }, |
Nils Diewald | 4c22125 | 2015-04-21 20:19:25 +0000 | [diff] [blame^] | 18 | |
| 19 | /** |
| 20 | * A click event was released |
| 21 | */ |
| 22 | release : function (key, type) { |
Nils Diewald | 1fcb2ad | 2015-04-20 19:19:18 +0000 | [diff] [blame] | 23 | if (this._cb !== undefined) |
Nils Diewald | 4c22125 | 2015-04-21 20:19:25 +0000 | [diff] [blame^] | 24 | this._cb(key, type); |
Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame] | 25 | } |
| 26 | }; |
| 27 | }); |