mirror of https://github.com/ElemeFE/element
Slider: reset size on click / drag
parent
4ebb998346
commit
735ef1ac51
|
@ -138,6 +138,7 @@
|
||||||
onDragging(event) {
|
onDragging(event) {
|
||||||
if (this.dragging) {
|
if (this.dragging) {
|
||||||
this.displayTooltip();
|
this.displayTooltip();
|
||||||
|
this.$parent.resetSize();
|
||||||
let diff = 0;
|
let diff = 0;
|
||||||
if (this.vertical) {
|
if (this.vertical) {
|
||||||
this.currentY = event.clientY;
|
this.currentY = event.clientY;
|
||||||
|
|
|
@ -221,6 +221,7 @@
|
||||||
|
|
||||||
onSliderClick(event) {
|
onSliderClick(event) {
|
||||||
if (this.disabled || this.dragging) return;
|
if (this.disabled || this.dragging) return;
|
||||||
|
this.resetSize();
|
||||||
if (this.vertical) {
|
if (this.vertical) {
|
||||||
const sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom;
|
const sliderOffsetBottom = this.$refs.slider.getBoundingClientRect().bottom;
|
||||||
this.setPosition((sliderOffsetBottom - event.clientY) / this.sliderSize * 100);
|
this.setPosition((sliderOffsetBottom - event.clientY) / this.sliderSize * 100);
|
||||||
|
|
Loading…
Reference in New Issue