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;
}
set tripleState(value) {
this._tripleState = value;
this.checkIntermediate();
}
get tripleState() {
return this._tripleState;
}
checkIntermediate() {
if ((this.intermediate || (!this._field && this.tripleState)) && !this.isIntermediate) {
this.isIntermediate = true;
return;
}
this.isIntermediate = false;
if (!this.intermediate)
this.isIntermediate = false;
}
}
Controller.$inject = ['$element', '$scope', '$attrs'];