blob: 17ad073e97ac35fa95f8a5c802299715a1c4d178 [file] [log] [blame]
/**
* Menu showing all key fields.
*/
define(['menu', 'vc/item'], function (menuClass, itemClass) {
return {
create : function (params) {
var obj = Object.create(menuClass)
.upgradeTo(this)
._init(itemClass, undefined, params);
obj.limit(6);
// This is only domspecific
obj.element().addEventListener('blur', function (e) {
this.menu.hide();
});
return obj;
},
/**
* Register callback for click event.
*/
released : function (cb) {
this._cb = cb;
},
/**
* A click event was released
*/
release : function (key, type) {
if (this._cb !== undefined)
this._cb(key, type);
}
};
});