[all] refactoring for disabled state of radiobox

This commit is contained in:
Maxim Kadushkin 2021-10-01 12:13:41 +03:00
parent bd7fb9a4f0
commit ef34139e9b
2 changed files with 7 additions and 7 deletions

View file

@ -121,6 +121,7 @@ define([
this.$label.on('keydown', this.onKeyDown.bind(this));
this.$label.find('svg, span').on('click', function(e) {
if ( !this.disabled )
this.setValue(true);
}.bind(this));
@ -163,12 +164,10 @@ define([
setValue: function(value, suspendchange) {
if (this.rendered) {
if ( !this.disabled ) {
var lastValue = this.$radio.hasClass('checked');
this.setRawValue(value);
if (suspendchange !== true && lastValue !== value)
this.trigger('change', this, this.$radio.is(':checked'));
}
} else {
this.options.checked = value;
}

View file

@ -33,6 +33,7 @@
&.disabled, &:disabled {
svg, span {
opacity: @component-disabled-opacity;
pointer-events: none;
}
}