blob: cc6cdf0a5a8a4e14a7afa1adebe63b6adde546b0 [file] [log] [blame]
Akron6bb71582016-06-10 20:41:08 +02001define(['menu/item'], function (itemClass) {
2 /**
3 * Menu item for select menus.
4 */
5
6 return {
7
8 /**
9 * Create new menu item
10 * for tree views.
11 */
12 create : function (params) {
13 return Object.create(itemClass)
14 .upgradeTo(this)._init(params);
15 },
16
17 /**
18 * Override click action of the menu item.
19 */
20 onclick : function (e) {
21 var menu = this.menu();
22 menu.hide();
23 // Index was set on initialization
24 menu.select(this._index);
25 menu.showTitle();
26 e.halt();
27 },
28
29 title : function () {
30 return this.content().textContent;
31 }
32 };
33});