Skip to content

Commit

Permalink
Refactor computeLimit to use min/max
Browse files Browse the repository at this point in the history
  • Loading branch information
megheaiulian authored and nomego committed Jan 9, 2018
1 parent 8c75cb4 commit f4ce156
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cosmoz-omnitable-column-range-behavior.html
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
},

Expand Down

0 comments on commit f4ce156

Please sign in to comment.