|
|
@ -56,10 +56,17 @@ BI.SingleSliderLabel = BI.inherit(BI.Single, { |
|
|
|
}); |
|
|
|
}); |
|
|
|
this._draggable(this.slider); |
|
|
|
this._draggable(this.slider); |
|
|
|
var sliderVertical = BI.createWidget({ |
|
|
|
var sliderVertical = BI.createWidget({ |
|
|
|
type: "bi.vertical", |
|
|
|
type: "bi.vertical_adapt", |
|
|
|
|
|
|
|
columnSize: ["fill"], |
|
|
|
items: [{ |
|
|
|
items: [{ |
|
|
|
type: "bi.absolute", |
|
|
|
type: "bi.absolute", |
|
|
|
items: [this.slider] |
|
|
|
items: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
el: this.slider, |
|
|
|
|
|
|
|
top: 8, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
], |
|
|
|
|
|
|
|
height: c.SLIDER_HEIGHT |
|
|
|
}], |
|
|
|
}], |
|
|
|
hgap: c.SLIDER_WIDTH_HALF, |
|
|
|
hgap: c.SLIDER_WIDTH_HALF, |
|
|
|
height: c.SLIDER_HEIGHT |
|
|
|
height: c.SLIDER_HEIGHT |
|
|
@ -171,7 +178,7 @@ BI.SingleSliderLabel = BI.inherit(BI.Single, { |
|
|
|
self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE); |
|
|
|
self.fireEvent(BI.SingleSliderLabel.EVENT_CHANGE); |
|
|
|
}, window); |
|
|
|
}, window); |
|
|
|
widget.element.on("mousedown", function (event) { |
|
|
|
widget.element.on("mousedown", function (event) { |
|
|
|
if(!widget.isEnabled()) { |
|
|
|
if (!widget.isEnabled()) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
defaultSize = this.offsetLeft; |
|
|
|
defaultSize = this.offsetLeft; |
|
|
@ -179,7 +186,7 @@ BI.SingleSliderLabel = BI.inherit(BI.Single, { |
|
|
|
mouseMoveTracker.captureMouseMoves(event); |
|
|
|
mouseMoveTracker.captureMouseMoves(event); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
function optimizeSize (s) { |
|
|
|
function optimizeSize(s) { |
|
|
|
return BI.clamp(s, 0, self._getGrayTrackLength()); |
|
|
|
return BI.clamp(s, 0, self._getGrayTrackLength()); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
@ -219,7 +226,7 @@ BI.SingleSliderLabel = BI.inherit(BI.Single, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_setBlueTrack: function (percent) { |
|
|
|
_setBlueTrack: function (percent) { |
|
|
|
this.blueTrack.element.css({width: percent + "%"}); |
|
|
|
this.blueTrack.element.css({ width: percent + "%" }); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_setLabelPosition: function (percent) { |
|
|
|
_setLabelPosition: function (percent) { |
|
|
@ -227,7 +234,7 @@ BI.SingleSliderLabel = BI.inherit(BI.Single, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_setSliderPosition: function (percent) { |
|
|
|
_setSliderPosition: function (percent) { |
|
|
|
this.slider.element.css({left: percent + "%"}); |
|
|
|
this.slider.element.css({ left: percent + "%" }); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_setAllPosition: function (percent) { |
|
|
|
_setAllPosition: function (percent) { |
|
|
@ -256,7 +263,7 @@ BI.SingleSliderLabel = BI.inherit(BI.Single, { |
|
|
|
|
|
|
|
|
|
|
|
_setEnable: function (b) { |
|
|
|
_setEnable: function (b) { |
|
|
|
BI.SingleSliderLabel.superclass._setEnable.apply(this, [b]); |
|
|
|
BI.SingleSliderLabel.superclass._setEnable.apply(this, [b]); |
|
|
|
if(b) { |
|
|
|
if (b) { |
|
|
|
this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"); |
|
|
|
this.blueTrack.element.removeClass("disabled-blue-track").addClass("blue-track"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track"); |
|
|
|
this.blueTrack.element.removeClass("blue-track").addClass("disabled-blue-track"); |
|
|
@ -287,7 +294,7 @@ BI.SingleSliderLabel = BI.inherit(BI.Single, { |
|
|
|
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; |
|
|
|
} |
|
|
|
} |
|
|
|