Browse Source

Merge pull request #137 in FUI/fineui from ~GUY/fineui:master to master

* commit '7abc150d00d982464aaa659ed94cc815b7bce439':
  update
  update
  update
es6
guy 7 years ago
parent
commit
17f82bb6d6
  1. 7
      bi/sliders.js
  2. 1
      demo/js/addons/slider/demo.slider.js
  3. 1
      dist/demo.js
  4. 7
      dist/sliders.js
  5. 7
      src/addons/sliders/js/intervalslider/intervalslider.label.js

7
bi/sliders.js

@ -552,6 +552,7 @@ BI.IntervalSliderLabel = BI.inherit(BI.Widget, {
var v = self._getValueByPercent(significantPercent);
v = self._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
self.labelOne.setValue(v);
self.labelOne.setText(v + o.unit);
self.valueOne = v;
self._setBlueTrack();
@ -578,6 +579,7 @@ BI.IntervalSliderLabel = BI.inherit(BI.Widget, {
var v = self._getValueByPercent(significantPercent);
v = self._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
self.labelTwo.setValue(v);
self.labelTwo.setText(v + o.unit);
self.valueTwo = v;
self._setBlueTrack();
@ -901,16 +903,21 @@ BI.IntervalSliderLabel = BI.inherit(BI.Widget, {
},
populate: function () {
var o = this.options;
if (!isNaN(this.min) && !isNaN(this.max)) {
this.enable = true;
this._setVisible(true);
if ((BI.isNumeric(this.valueOne) || BI.isNotEmptyString(this.valueOne)) && (BI.isNumeric(this.valueTwo) || BI.isNotEmptyString(this.valueTwo))) {
this.labelOne.setValue(this.valueOne);
this.labelTwo.setValue(this.valueTwo);
this.labelOne.setText(this.valueOne + o.unit);
this.labelTwo.setText(this.valueTwo + o.unit);
this._setAllPosition(this._getPercentByValue(this.valueOne), this._getPercentByValue(this.valueTwo));
} else {
this.labelOne.setValue(this.min);
this.labelTwo.setValue(this.max);
this.labelOne.setText(this.min + o.unit);
this.labelTwo.setText(this.max + o.unit);
this._setAllPosition(0, 100)
}
}

1
demo/js/addons/slider/demo.slider.js

@ -78,6 +78,7 @@ Demo.Slider = BI.inherit(BI.Widget, {
var intervalSliderLabel = BI.createWidget({
type: "bi.interval_slider_label",
width: 300,
unit: "个",
cls: "layout-bg-white"
});
intervalSliderLabel.setMinAndMax({

1
dist/demo.js vendored

@ -89,6 +89,7 @@ Demo.Slider = BI.inherit(BI.Widget, {
var intervalSliderLabel = BI.createWidget({
type: "bi.interval_slider_label",
width: 300,
unit: "个",
cls: "layout-bg-white"
});
intervalSliderLabel.setMinAndMax({

7
dist/sliders.js vendored

@ -552,6 +552,7 @@ BI.IntervalSliderLabel = BI.inherit(BI.Widget, {
var v = self._getValueByPercent(significantPercent);
v = self._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
self.labelOne.setValue(v);
self.labelOne.setText(v + o.unit);
self.valueOne = v;
self._setBlueTrack();
@ -578,6 +579,7 @@ BI.IntervalSliderLabel = BI.inherit(BI.Widget, {
var v = self._getValueByPercent(significantPercent);
v = self._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
self.labelTwo.setValue(v);
self.labelTwo.setText(v + o.unit);
self.valueTwo = v;
self._setBlueTrack();
@ -901,16 +903,21 @@ BI.IntervalSliderLabel = BI.inherit(BI.Widget, {
},
populate: function () {
var o = this.options;
if (!isNaN(this.min) && !isNaN(this.max)) {
this.enable = true;
this._setVisible(true);
if ((BI.isNumeric(this.valueOne) || BI.isNotEmptyString(this.valueOne)) && (BI.isNumeric(this.valueTwo) || BI.isNotEmptyString(this.valueTwo))) {
this.labelOne.setValue(this.valueOne);
this.labelTwo.setValue(this.valueTwo);
this.labelOne.setText(this.valueOne + o.unit);
this.labelTwo.setText(this.valueTwo + o.unit);
this._setAllPosition(this._getPercentByValue(this.valueOne), this._getPercentByValue(this.valueTwo));
} else {
this.labelOne.setValue(this.min);
this.labelTwo.setValue(this.max);
this.labelOne.setText(this.min + o.unit);
this.labelTwo.setText(this.max + o.unit);
this._setAllPosition(0, 100)
}
}

7
src/addons/sliders/js/intervalslider/intervalslider.label.js

@ -69,6 +69,7 @@ BI.IntervalSliderLabel = BI.inherit(BI.Widget, {
var v = self._getValueByPercent(significantPercent);
v = self._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
self.labelOne.setValue(v);
self.labelOne.setText(v + o.unit);
self.valueOne = v;
self._setBlueTrack();
@ -95,6 +96,7 @@ BI.IntervalSliderLabel = BI.inherit(BI.Widget, {
var v = self._getValueByPercent(significantPercent);
v = self._assertValue(v);
v = o.digit === false ? v : v.toFixed(o.digit);
self.labelTwo.setValue(v);
self.labelTwo.setText(v + o.unit);
self.valueTwo = v;
self._setBlueTrack();
@ -418,16 +420,21 @@ BI.IntervalSliderLabel = BI.inherit(BI.Widget, {
},
populate: function () {
var o = this.options;
if (!isNaN(this.min) && !isNaN(this.max)) {
this.enable = true;
this._setVisible(true);
if ((BI.isNumeric(this.valueOne) || BI.isNotEmptyString(this.valueOne)) && (BI.isNumeric(this.valueTwo) || BI.isNotEmptyString(this.valueTwo))) {
this.labelOne.setValue(this.valueOne);
this.labelTwo.setValue(this.valueTwo);
this.labelOne.setText(this.valueOne + o.unit);
this.labelTwo.setText(this.valueTwo + o.unit);
this._setAllPosition(this._getPercentByValue(this.valueOne), this._getPercentByValue(this.valueTwo));
} else {
this.labelOne.setValue(this.min);
this.labelTwo.setValue(this.max);
this.labelOne.setText(this.min + o.unit);
this.labelTwo.setText(this.max + o.unit);
this._setAllPosition(0, 100)
}
}

Loading…
Cancel
Save