From 062afd48e24ef4daedb268174f09301281000ecb Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 4 Dec 2019 10:31:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?BI-56574=20fix:=20setValue=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=EF=BC=8Cpopulate=E9=9C=80=E8=A6=81=E5=88=B7=E6=96=B0l?= =?UTF-8?q?abel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/intervalslider/intervalslider.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/widget/intervalslider/intervalslider.js b/src/widget/intervalslider/intervalslider.js index fb97a2a25..1c3818252 100644 --- a/src/widget/intervalslider/intervalslider.js +++ b/src/widget/intervalslider/intervalslider.js @@ -334,11 +334,15 @@ BI.IntervalSlider = BI.inherit(BI.Single, { valueTwo = BI.parseFloat(valueTwo); if((oldValueOne <= oldValueTwo && valueOne > valueTwo) || (oldValueOne >= oldValueTwo && valueOne < valueTwo)) { var isSliderOneLeft = BI.parseFloat(this.sliderOne.element[0].style.left) < BI.parseFloat(this.sliderTwo.element[0].style.left); - this.labelOne.element.css({left: isSliderOneLeft ? "0%" : "100%"}); - this.labelTwo.element.css({left: isSliderOneLeft ? "100%" : "0%"}); + this._resetLabelPosition(!isSliderOneLeft); } }, + _resetLabelPosition: function(needReverse) { + this.labelOne.element.css({left: needReverse ? "100%" : "0%"}); + this.labelTwo.element.css({left: needReverse ? "0%" : "100%"}); + }, + _setSliderOnePosition: function (percent) { this.sliderOne.element.css({left: percent + "%"}); }, @@ -481,8 +485,8 @@ BI.IntervalSlider = BI.inherit(BI.Single, { var o = this.options; var valueOne = BI.parseFloat(v.min); var valueTwo = BI.parseFloat(v.max); - valueOne = o.digit === false ? valueOne : valueOne.toFixed(o.digit); - valueTwo = o.digit === false ? valueTwo : valueTwo.toFixed(o.digit); + valueOne = o.digit === false ? valueOne : BI.parseFloat(valueOne.toFixed(o.digit)); + valueTwo = o.digit === false ? valueTwo : BI.parseFloat(valueTwo.toFixed(o.digit)); if (!isNaN(valueOne) && !isNaN(valueTwo)) { if (this._checkValidation(valueOne)) { this.valueOne = (this.valueOne <= this.valueTwo ? valueOne : valueTwo); @@ -523,6 +527,7 @@ BI.IntervalSlider = BI.inherit(BI.Single, { this.labelTwo.setValue(this.max); this._setAllPosition(0, 100); } + this._resetLabelPosition(); } } }); From 5eb78f65aceffd1de9776ff0b4c0d30cc8283551 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Wed, 4 Dec 2019 10:33:32 +0800 Subject: [PATCH 2/2] changelog --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index d73c1ae25..c79ca8f1d 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2019-12) +- 修复了数值滑块逆向排列滑块后populate显示效果不对的问题 - 不影响父节点勾选状态的复选树支持自定义水印和默认值 2.0(2019-11)