|
880 | 880 | updateLowHandle: function(newOffset) {
|
881 | 881 | this.setPosition(this.minH, newOffset);
|
882 | 882 | this.translateFn(this.scope.rzSliderModel, this.minLab);
|
883 |
| - var pos = Math.min(Math.max(newOffset - this.minLab.rzsd / 2 + this.handleHalfDim, 0), this.barDimension - this.ceilLab.rzsd); |
| 883 | + var pos = Math.min( |
| 884 | + Math.max( |
| 885 | + newOffset - this.minLab.rzsd / 2 + this.handleHalfDim, |
| 886 | + 0 |
| 887 | + ), |
| 888 | + this.barDimension - this.ceilLab.rzsd |
| 889 | + ); |
884 | 890 | this.setPosition(this.minLab, pos);
|
885 | 891 |
|
886 | 892 | this.shFloorCeil();
|
|
895 | 901 | updateHighHandle: function(newOffset) {
|
896 | 902 | this.setPosition(this.maxH, newOffset);
|
897 | 903 | this.translateFn(this.scope.rzSliderHigh, this.maxLab);
|
898 |
| - var pos = Math.min((newOffset - this.maxLab.rzsd / 2 + this.handleHalfDim), (this.barDimension - this.ceilLab.rzsd)); |
| 904 | + var pos = Math.min(newOffset - this.maxLab.rzsd / 2 + this.handleHalfDim, this.barDimension - this.ceilLab.rzsd); |
899 | 905 | this.setPosition(this.maxLab, pos);
|
900 | 906 |
|
901 | 907 | this.shFloorCeil();
|
|
950 | 956 | updateSelectionBar: function() {
|
951 | 957 | var position = 0,
|
952 | 958 | dimension = 0;
|
953 |
| - if(this.range) { |
954 |
| - dimension = Math.abs(this.maxH.rzsp - this.minH.rzsp) + this.handleHalfDim; |
| 959 | + if (this.range) { |
| 960 | + dimension = Math.abs(this.maxH.rzsp - this.minH.rzsp); |
955 | 961 | position = this.minH.rzsp + this.handleHalfDim;
|
956 | 962 | }
|
957 | 963 | else {
|
|
1001 | 1007 | * @returns {undefined}
|
1002 | 1008 | */
|
1003 | 1009 | updateCmbLabel: function() {
|
1004 |
| - var lowTr, highTr; |
1005 | 1010 |
|
1006 | 1011 | if (this.minLab.rzsp + this.minLab.rzsd + 10 >= this.maxLab.rzsp) {
|
1007 |
| - lowTr = this.getDisplayValue(this.scope.rzSliderModel); |
1008 |
| - highTr = this.getDisplayValue(this.scope.rzSliderHigh); |
1009 |
| - |
1010 |
| - this.translateFn(lowTr + ' - ' + highTr, this.cmbLab, false); |
1011 |
| - var pos = Math.min(Math.max((this.selBar.rzsp + this.selBar.rzsd / 2 - this.cmbLab.rzsd / 2), 0), (this.barDimension - this.cmbLab.rzsd)); |
| 1012 | + var lowTr = this.getDisplayValue(this.scope.rzSliderModel), |
| 1013 | + highTr = this.getDisplayValue(this.scope.rzSliderHigh), |
| 1014 | + labelVal = lowTr === highTr ? lowTr : lowTr + ' - ' + highTr; |
| 1015 | + |
| 1016 | + this.translateFn(labelVal, this.cmbLab, false); |
| 1017 | + var pos = Math.min( |
| 1018 | + Math.max( |
| 1019 | + this.selBar.rzsp + this.selBar.rzsd / 2 - this.cmbLab.rzsd / 2, |
| 1020 | + 0 |
| 1021 | + ), |
| 1022 | + this.barDimension - this.cmbLab.rzsd |
| 1023 | + ); |
1012 | 1024 | this.setPosition(this.cmbLab, pos);
|
1013 | 1025 | this.hideEl(this.minLab);
|
1014 | 1026 | this.hideEl(this.maxLab);
|
|
0 commit comments