Checkbox.js (tine20-2020.08.3) | : | Checkbox.js (tine20-2020.08.4) | ||
---|---|---|---|---|
skipping to change at line 116 | skipping to change at line 116 | |||
} | } | |||
this.wrap = this.el.wrap({cls: 'x-form-check-wrap'}); | this.wrap = this.el.wrap({cls: 'x-form-check-wrap'}); | |||
if(this.boxLabel){ | if(this.boxLabel){ | |||
this.wrap.createChild({tag: 'label', htmlFor: this.el.id, cls: 'x-fo rm-cb-label', html: this.boxLabel}); | this.wrap.createChild({tag: 'label', htmlFor: this.el.id, cls: 'x-fo rm-cb-label', html: this.boxLabel}); | |||
} | } | |||
if(this.checked){ | if(this.checked){ | |||
this.setValue(true); | this.setValue(true); | |||
}else{ | }else{ | |||
this.checked = this.el.dom.checked; | this.checked = this.el.dom.checked; | |||
} | } | |||
this.el.dom.disabled = this.readOnly || this.disabled; | ||||
// Need to repaint for IE, otherwise positioning is broken | // Need to repaint for IE, otherwise positioning is broken | |||
if(Ext.isIE){ | if(Ext.isIE){ | |||
this.wrap.repaint(); | this.wrap.repaint(); | |||
} | } | |||
this.resizeEl = this.positionEl = this.wrap; | this.resizeEl = this.positionEl = this.wrap; | |||
}, | }, | |||
// private | // private | |||
onDestroy : function(){ | onDestroy : function(){ | |||
Ext.destroy(this.wrap); | Ext.destroy(this.wrap); | |||
skipping to change at line 145 | skipping to change at line 146 | |||
* Returns the checked state of the checkbox. | * Returns the checked state of the checkbox. | |||
* @return {Boolean} True if checked, else false | * @return {Boolean} True if checked, else false | |||
*/ | */ | |||
getValue : function(){ | getValue : function(){ | |||
if(this.rendered){ | if(this.rendered){ | |||
return this.el.dom.checked; | return this.el.dom.checked; | |||
} | } | |||
return this.checked; | return this.checked; | |||
}, | }, | |||
setReadOnly: function(readOnly){ | ||||
if (this.rendered) { | ||||
this.el.dom.disabled = readOnly || this.disabled; | ||||
} | ||||
return Ext.form.Checkbox.superclass.setReadOnly.call(this, readOnly); | ||||
}, | ||||
setDisabled: function(disabled){ | ||||
Ext.form.Checkbox.superclass.setDisabled.call(this, disabled); | ||||
if (this.rendered) { | ||||
this.el.dom.disabled = this.readOnly || disabled; | ||||
} | ||||
return this; | ||||
}, | ||||
// private | // private | |||
onClick : function(){ | onClick : function(){ | |||
if(this.el.dom.checked != this.checked){ | if(this.el.dom.checked != this.checked){ | |||
this.setValue(this.el.dom.checked); | this.setValue(this.el.dom.checked); | |||
if (this.blurOnChange) { | ||||
this.el.blur(); | ||||
} | ||||
} | } | |||
}, | }, | |||
/** | /** | |||
* Sets the checked state of the checkbox, fires the 'check' event, and call s a | * Sets the checked state of the checkbox, fires the 'check' event, and call s a | |||
* <code>{@link #handler}</code> (if configured). | * <code>{@link #handler}</code> (if configured). | |||
* @param {Boolean/String} checked The following values will check the check box: | * @param {Boolean/String} checked The following values will check the check box: | |||
* <code>true, 'true', '1', or 'on'</code>. Any other value will uncheck the checkbox. | * <code>true, 'true', '1', or 'on'</code>. Any other value will uncheck the checkbox. | |||
* @return {Ext.form.Field} this | * @return {Ext.form.Field} this | |||
*/ | */ | |||
End of changes. 3 change blocks. | ||||
0 lines changed or deleted | 19 lines changed or added |