blob: 75003b8ad0787751bb45307072dd778bff734c67 [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)
Akronaba7a5a2016-08-15 21:58:33 +020014 .upgradeTo(this)._init(params);
Akron6bb71582016-06-10 20:41:08 +020015 },
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});