blob: 23341a4d856e494debd6fa2b5b8a0881e2ece221 [file] [log] [blame]
Nils Diewald0e6992a2015-04-14 20:13:52 +00001 /**
2 * Menu to choose from for tree views.
3 */
4define(['menu', 'match/treeitem'], function (menuClass, itemClass) {
5 "use strict";
6
7 return {
8 create : function (info, params) {
9 var obj = Object.create(menuClass)
10 .upgradeTo(this)
11 ._init(itemClass, undefined, params);
12 obj.limit(6);
13 obj._info = info;
14
15 // This is only domspecific
16 obj.element().addEventListener('blur', function (e) {
17 this.menu.hide();
18 });
19
20 return obj;
21 },
22 info :function () {
23 return this._info;
24 }
25 };
26});