| define(['menu/item', 'util'], function (itemClass) { |
| const loc = KorAP.Locale; |
| * Pass two parameters: value and type. |
| * the value may be localized by a name in |
| * KorAP.Locale with the prefix 'VC_', |
| create : function (params) { |
| return Object.create(itemClass) |
| // Initialize item object |
| _init : function (params) { |
| if (params[0] === undefined) |
| throw new Error("Missing parameters"); |
| t._lcField = ' ' + t._name.toLowerCase(); |
| t._lcField += ' ' + t._desc.toLowerCase(); |
| * Override click event by passing all clicks |
| * Get the name of the item. |
| * Get the identifier of the item. |
| * Get the description of the item. |
| * Get the HTML element associated with the item. |
| const li = document.createElement("li"); |
| li.setAttribute("data-type", t._type); |
| li.setAttribute("data-key", t._key); |
| li["onclick"] = t.onclick.bind(t); |