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