update Slider
This commit is contained in:
parent
bb1a3c38b4
commit
2f8104a321
1 changed files with 28 additions and 22 deletions
|
@ -360,7 +360,11 @@
|
|||
}
|
||||
},
|
||||
changeFirstPosition (newPos) {
|
||||
if (newPos >= 0 && (newPos <= this.secondPosition)) {
|
||||
if (newPos < 0) {
|
||||
newPos = 0;
|
||||
} else if (newPos > this.secondPosition) {
|
||||
newPos = this.secondPosition;
|
||||
}
|
||||
const lengthPerStep = 100 / ((this.max - this.min) / this.step);
|
||||
const steps = Math.round(newPos / lengthPerStep);
|
||||
|
||||
|
@ -373,7 +377,6 @@
|
|||
this.oldFirstValue = this.currentValue[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
setFirstPosition (val) {
|
||||
this.firstPosition = (val - this.min) / (this.max - this.min) * 100;
|
||||
|
@ -410,7 +413,11 @@
|
|||
}
|
||||
},
|
||||
changeSecondPosition (newPos) {
|
||||
if (newPos >= this.firstPosition && (newPos <= 100)) {
|
||||
if (newPos > 100) {
|
||||
newPos = 100;
|
||||
} else if (newPos < this.firstPosition) {
|
||||
newPos = this.firstPosition;
|
||||
}
|
||||
const lengthPerStep = 100 / ((this.max - this.min) / this.step);
|
||||
const steps = Math.round(newPos / lengthPerStep);
|
||||
|
||||
|
@ -423,7 +430,6 @@
|
|||
this.oldSecondValue = this.currentValue[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
setSecondPosition (val) {
|
||||
this.secondPosition = (val - this.min) / (this.max - this.min) * 100;
|
||||
|
|
Loading…
Add table
Reference in a new issue