参数界面中的数值滑块控件。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

55 lines
1.6 KiB

(function ($) {
FR.ParameterSlider = FR.extend(FR.Widget, {
_defaultConfig: function () {
return $.extend(FR.ParameterSlider.superclass._defaultConfig.apply(), {
showWidth: 500,
showHeight: 280,
defaultWidth: 80
});
},
_init: function () {
FR.ParameterSlider.superclass._init.apply(this, arguments);
var opts = this.options;
var normalSingleSlider = BI.createWidget({
type: "bi.single_slider",
width: opts.width,
height: opts.height,
cls: "layout-bg-white"
});
normalSingleSlider.setMinAndMax({
min: 0,
max: 100
});
normalSingleSlider.setValue(10);
normalSingleSlider.populate();
this.loader = normalSingleSlider;
BI.createWidget({
type: "bi.vertical",
element: this.element,
items: [{
type: "bi.center_adapt",
items: [{
el: normalSingleSlider
}]
}]
});
},
getValue: function () {
return this.loader.getValue();
},
setValue: function (value) {
this.loader.setValue(value);
},
setText: function (text) {
this.editComp.val(text);
},
getText: function () {
return this.editComp.val();
}
});
$.shortcut('parameter.slider', FR.ParameterSlider);
})(jQuery);