From c3903b8d514e0ba3d6b0349ca29d2b1d48716396 Mon Sep 17 00:00:00 2001 From: Gerard Date: Fri, 15 Feb 2019 08:49:44 +0100 Subject: [PATCH] added tripleState setter --- front/core/components/check/check.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/front/core/components/check/check.js b/front/core/components/check/check.js index 9c67cb502..63d049264 100644 --- a/front/core/components/check/check.js +++ b/front/core/components/check/check.js @@ -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'];