ucan-ext-js-kitchen-sink
Version:
my-ext-gen-app description for Ext JS app MyExtGenApp
19 lines (17 loc) • 498 B
JavaScript
Ext.define('UCAN.common.util.components.LabelTapToggleField', {
extend: 'Ext.field.Toggle',
xtype: 'labelTapToggleField',
initialize: function(args) {
this.callParent(args);
const labelEl = this.labelElement;
labelEl.on('tap', this.toggle, this);
},
updateValue: function(value, oldValue) {
if (value) {
this.removeCls('ucan-togglefield-off-gray');
} else {
this.addCls('ucan-togglefield-off-gray');
}
this.callParent([value, oldValue]);
},
});