added tripleState setter

This commit is contained in:
Gerard 2019-02-15 08:49:44 +01:00
parent fe2c74c8c8
commit c3903b8d51
1 changed files with 11 additions and 1 deletions

View File

@ -37,13 +37,23 @@ export default class Controller extends Component {
return this._field; return this._field;
} }
set tripleState(value) {
this._tripleState = value;
this.checkIntermediate();
}
get tripleState() {
return this._tripleState;
}
checkIntermediate() { checkIntermediate() {
if ((this.intermediate || (!this._field && this.tripleState)) && !this.isIntermediate) { if ((this.intermediate || (!this._field && this.tripleState)) && !this.isIntermediate) {
this.isIntermediate = true; this.isIntermediate = true;
return; return;
} }
this.isIntermediate = false; if (!this.intermediate)
this.isIntermediate = false;
} }
} }
Controller.$inject = ['$element', '$scope', '$attrs']; Controller.$inject = ['$element', '$scope', '$attrs'];