|
|
@ -14940,7 +14940,7 @@ BI.SingleSlider = BI.inherit(BI.Widget, { |
|
|
|
scroll: false, |
|
|
|
scroll: false, |
|
|
|
drag: function (e, ui) { |
|
|
|
drag: function (e, ui) { |
|
|
|
var percent = (ui.position.left) * 100 / (self._getGrayTrackLength()); |
|
|
|
var percent = (ui.position.left) * 100 / (self._getGrayTrackLength()); |
|
|
|
var significantPercent = BI.parseFloat(percent.toFixed(1));//直接对计算出来的百分数保留到小数点后一位,相当于分成了1000份。
|
|
|
|
var significantPercent = BI.parseFloat(percent.toFixed(1)); //直接对计算出来的百分数保留到小数点后一位,相当于分成了1000份。
|
|
|
|
self._setBlueTrack(significantPercent); |
|
|
|
self._setBlueTrack(significantPercent); |
|
|
|
self._setLabelPosition(significantPercent); |
|
|
|
self._setLabelPosition(significantPercent); |
|
|
|
var v = self._getValueByPercent(significantPercent); |
|
|
|
var v = self._getValueByPercent(significantPercent); |
|
|
@ -14987,7 +14987,7 @@ BI.SingleSlider = BI.inherit(BI.Widget, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
this.label = BI.createWidget({ |
|
|
|
this.label = BI.createWidget({ |
|
|
|
type: "bi.sign_editor", |
|
|
|
type: "bi.sign_editor", |
|
|
|
cls: "slider-editor-button bi-border", |
|
|
|
cls: "slider-editor-button", |
|
|
|
errorText: "", |
|
|
|
errorText: "", |
|
|
|
height: c.HEIGHT, |
|
|
|
height: c.HEIGHT, |
|
|
|
width: c.EDITOR_WIDTH, |
|
|
|
width: c.EDITOR_WIDTH, |
|
|
@ -15005,6 +15005,12 @@ BI.SingleSlider = BI.inherit(BI.Widget, { |
|
|
|
self._setAllPosition(significantPercent); |
|
|
|
self._setAllPosition(significantPercent); |
|
|
|
self.fireEvent(BI.SingleSlider.EVENT_CHANGE); |
|
|
|
self.fireEvent(BI.SingleSlider.EVENT_CHANGE); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
this.label.on(BI.SignEditor.EVENT_FOCUS, function () { |
|
|
|
|
|
|
|
self.label.element.addClass("bi-border"); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.label.on(BI.SignEditor.EVENT_BLUR, function () { |
|
|
|
|
|
|
|
self.label.element.removeClass("bi-border"); |
|
|
|
|
|
|
|
}); |
|
|
|
this._setVisible(false); |
|
|
|
this._setVisible(false); |
|
|
|
BI.createWidget({ |
|
|
|
BI.createWidget({ |
|
|
|
type: "bi.absolute", |
|
|
|
type: "bi.absolute", |
|
|
@ -15038,7 +15044,7 @@ BI.SingleSlider = BI.inherit(BI.Widget, { |
|
|
|
type: "bi.absolute", |
|
|
|
type: "bi.absolute", |
|
|
|
items: [this.label] |
|
|
|
items: [this.label] |
|
|
|
}], |
|
|
|
}], |
|
|
|
rgap: c.EDITOR_WIDTH/2, |
|
|
|
rgap: c.EDITOR_WIDTH / 2, |
|
|
|
height: c.EDITOR_HEIGHT |
|
|
|
height: c.EDITOR_HEIGHT |
|
|
|
}, |
|
|
|
}, |
|
|
|
top: 0, |
|
|
|
top: 0, |
|
|
@ -15086,15 +15092,21 @@ BI.SingleSlider = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_setBlueTrack: function (percent) { |
|
|
|
_setBlueTrack: function (percent) { |
|
|
|
this.blueTrack.element.css({"width": percent + "%"}); |
|
|
|
this.blueTrack.element.css({ |
|
|
|
|
|
|
|
"width": percent + "%" |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_setLabelPosition: function (percent) { |
|
|
|
_setLabelPosition: function (percent) { |
|
|
|
this.label.element.css({"left": percent + "%"}); |
|
|
|
this.label.element.css({ |
|
|
|
|
|
|
|
"left": percent + "%" |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_setSliderPosition: function (percent) { |
|
|
|
_setSliderPosition: function (percent) { |
|
|
|
this.slider.element.css({"left": percent + "%"}); |
|
|
|
this.slider.element.css({ |
|
|
|
|
|
|
|
"left": percent + "%" |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_setAllPosition: function (percent) { |
|
|
|
_setAllPosition: function (percent) { |
|
|
@ -15143,7 +15155,7 @@ BI.SingleSlider = BI.inherit(BI.Widget, { |
|
|
|
setMinAndMax: function (v) { |
|
|
|
setMinAndMax: function (v) { |
|
|
|
var minNumber = BI.parseFloat(v.min); |
|
|
|
var minNumber = BI.parseFloat(v.min); |
|
|
|
var maxNumber = BI.parseFloat(v.max); |
|
|
|
var maxNumber = BI.parseFloat(v.max); |
|
|
|
if ((!isNaN(minNumber)) && (!isNaN(maxNumber)) && (maxNumber > minNumber )) { |
|
|
|
if ((!isNaN(minNumber)) && (!isNaN(maxNumber)) && (maxNumber > minNumber)) { |
|
|
|
this.min = minNumber; |
|
|
|
this.min = minNumber; |
|
|
|
this.max = maxNumber; |
|
|
|
this.max = maxNumber; |
|
|
|
} |
|
|
|
} |
|
|
|