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.
27 lines (22 loc) • 794 B
JavaScript
import { Handlebars } from 'lib';
import ReferenceButtonView from './ReferenceButtonView';
import template from '../templates/userReferenceButton.hbs';
export default ReferenceButtonView.extend({
template: Handlebars.compile(template),
className: 'popout-field-user',
templateHelpers() {
const value = this.model.get('value');
return {
text: this.options.getDisplayText(value)
};
},
updateView() {
if (this.model.get('enabled') && !this.model.get('readonly')) {
this.ui.clearButton.show();
} else if (this.model.get('readonly')) {
this.ui.clearButton.hide();
} else if (!this.model.get('enabled')) {
this.ui.clearButton.hide();
}
}
});