| define(['menu/item'], function (itemClass) { |
| * Menu item for tree view choice. |
| create : function (params) { |
| return Object.create(itemClass) |
| .upgradeTo(this)._init(params); |
| * Get or set the content of the |
| content : function (content) { |
| if (arguments.length === 1) { |
| * The foundry attribute of the menu item. |
| * The layer attribute of the menu item. |
| * Override click action of the menu item. |
| if (menu.info() !== undefined) |
| menu.info().addTree(this._foundry, this._layer); |
| // Initialize tree menu item. |
| _init : function (params) { |
| if (params[0] === undefined) |
| throw new Error("Missing parameters"); |
| this._foundry = params[1]; |
| this._content = document.createTextNode(this._name); |
| this._lcField = ' ' + this.content().textContent.toLowerCase(); |