Merge pull request #1355 from oustn/2.0

修复 Slider 滑动按钮单击时数值跳动 issue
This commit is contained in:
Aresn 2017-09-01 18:47:01 +08:00 committed by GitHub
commit 57f920ff65

View file

@ -285,11 +285,12 @@
on(window, 'mouseup', this.onSingleDragEnd);
},
onSingleDragStart (event) {
this.dragging = true;
this.dragging = false;
this.startX = event.clientX;
this.startPos = parseInt(this.singlePosition, 10);
},
onSingleDragging (event) {
this.dragging = true;
if (this.dragging) {
this.$refs.tooltip.visible = true;
this.currentX = event.clientX;
@ -305,9 +306,9 @@
this.changeSinglePosition(this.newPos);
// window.removeEventListener('mousemove', this.onSingleDragging);
// window.removeEventListener('mouseup', this.onSingleDragEnd);
off(window, 'mousemove', this.onSingleDragging);
off(window, 'mouseup', this.onSingleDragEnd);
}
off(window, 'mousemove', this.onSingleDragging);
off(window, 'mouseup', this.onSingleDragEnd);
},
changeSinglePosition (newPos) {
if (newPos < 0) {
@ -348,11 +349,12 @@
on(window, 'mouseup', this.onFirstDragEnd);
},
onFirstDragStart (event) {
this.firstDragging = true;
this.firstDragging = false;
this.startX = event.clientX;
this.startPos = parseInt(this.firstPosition, 10);
},
onFirstDragging (event) {
this.firstDragging = true;
if (this.firstDragging) {
this.$refs.tooltip.visible = true;
this.currentX = event.clientX;
@ -368,9 +370,9 @@
this.changeFirstPosition(this.newPos);
// window.removeEventListener('mousemove', this.onFirstDragging);
// window.removeEventListener('mouseup', this.onFirstDragEnd);
off(window, 'mousemove', this.onFirstDragging);
off(window, 'mouseup', this.onFirstDragEnd);
}
off(window, 'mousemove', this.onFirstDragging);
off(window, 'mouseup', this.onFirstDragEnd);
},
changeFirstPosition (newPos) {
if (newPos < 0) {
@ -405,11 +407,12 @@
on(window, 'mouseup', this.onSecondDragEnd);
},
onSecondDragStart (event) {
this.secondDragging = true;
this.secondDragging = false;
this.startX = event.clientX;
this.startPos = parseInt(this.secondPosition, 10);
},
onSecondDragging (event) {
this.secondDragging = true;
if (this.secondDragging) {
this.$refs.tooltip2.visible = true;
this.currentX = event.clientX;
@ -425,9 +428,9 @@
this.changeSecondPosition(this.newPos);
// window.removeEventListener('mousemove', this.onSecondDragging);
// window.removeEventListener('mouseup', this.onSecondDragEnd);
off(window, 'mousemove', this.onSecondDragging);
off(window, 'mouseup', this.onSecondDragEnd);
}
off(window, 'mousemove', this.onSecondDragging);
off(window, 'mouseup', this.onSecondDragEnd);
},
changeSecondPosition (newPos) {
if (newPos > 100) {