| 'hint/lengthField'], function (menuClass, itemClass, prefixClass, lengthFieldClass) { |
| * Create new hint helper menu. |
| create : function (hint, context, params) { |
| var obj = Object.create(menuClass) |
| prefixClass : prefixClass, |
| lengthFieldClass : lengthFieldClass |
| obj._element.classList.add('hint'); |
| // Make the top item always active |
| // This is only domspecific |
| obj.element().addEventListener('blur', function (e) { |
| this.menu.hideWithoutDestruction(); |
| // Focus on input field on hide |
| obj.onHide = function () { |
| * The hint helper object, |
| * the menu is attached to. |
| * Hide the menu just for the moment, |
| * without cleaning up anything, |
| /* but resetting the prefix. |
| hideWithoutDestruction : function () { |
| this.element().classList.remove("visible"); |
| this._hint.inputField().element().focus(); |