Nils Diewald | 0e6992a | 2015-04-14 20:13:52 +0000 | [diff] [blame^] | 1 | /** |
| 2 | * Menu to choose from for tree views. |
| 3 | */ |
| 4 | define(['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 | }); |