From f4ce1568c9583fba39a4860e38a02a0fe35665fe Mon Sep 17 00:00:00 2001 From: Unknown Date: Tue, 9 Jan 2018 15:07:47 +0200 Subject: [PATCH] Refactor computeLimit to use min/max --- cosmoz-omnitable-column-range-behavior.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/cosmoz-omnitable-column-range-behavior.html b/cosmoz-omnitable-column-range-behavior.html index b56e08c7..20e46901 100644 --- a/cosmoz-omnitable-column-range-behavior.html +++ b/cosmoz-omnitable-column-range-behavior.html @@ -174,12 +174,14 @@ } const input = inputChange.base, nMin = this.toValue(min), - nMax = this.toValue(max); + nMax = this.toValue(max), + aMin = nMin != null ? nMin : this.toValue(range.min), + aMax = nMax != null ? nMax : this.toValue(range.max); return { - fromMin: nMin != null ? nMin : this.toValue(range.min), - fromMax: this.toValue(range.max, this._fromInputString(input.max, 'max'), Math.min), - toMin: this.toValue(range.min, this._fromInputString(input.min, 'min'), Math.max), - toMax: nMax != null ? nMax : this.toValue(range.max) + fromMin: aMin, + fromMax: this.toValue(aMax, this._fromInputString(input.max, 'max'), Math.min), + toMin: this.toValue(aMin, this._fromInputString(input.min, 'min'), Math.max), + toMax: aMax }; },