comindware.ui
Version:
Comindware Core UI provides the basic components like editors, lists, dropdowns, popups that we so desperately need while creating Marionette-based single-page applications.
46 lines (36 loc) • 1.08 kB
JavaScript
/**
* Developer: Stepan Burguchev
* Date: 11/26/2014
* Copyright: 2009-2016 Comindware®
* All Rights Reserved
* Published under the MIT license
*/
;
import { Handlebars } from 'lib';
import template from '../templates/menuItem.hbs';
/**
* @name MenuItemView
* @memberof module:core.dropdown.views
* @class Single menu item used by MenuPanelView to display a list of menu items.
* Factory method {@link module:core.dropdown.factory createMenu} uses it indirectly.
* {@link module:core.dropdown.factory createMenu}.
* @constructor
* @extends Marionette.ItemView
* */
export default Marionette.ItemView.extend({
initialize() {
},
tagName: 'li',
className: 'popout-menu__i',
template: Handlebars.compile(template),
templateHelpers() {
return {
getTitle: this.model.has('tooltip') ? this.model.get('tooltip') : this.model.get('name')
};
},
events: {
click() {
this.trigger('execute', this.model);
}
}
});