|
|
@ -108521,30 +108521,67 @@ BI.shortcut("bi.sign_text_editor", BI.SignTextEditor);/** |
|
|
|
* Created by zcf on 2016/9/22. |
|
|
|
* Created by zcf on 2016/9/22. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
BI.SliderIconButton = BI.inherit(BI.Widget, { |
|
|
|
BI.SliderIconButton = BI.inherit(BI.Widget, { |
|
|
|
_defaultConfig: function () { |
|
|
|
|
|
|
|
return BI.extend(BI.SliderIconButton.superclass._defaultConfig.apply(this, arguments), { |
|
|
|
props: { |
|
|
|
baseCls: "bi-single-slider-button" |
|
|
|
baseCls: "bi-single-slider-button" |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
_init: function () { |
|
|
|
|
|
|
|
BI.extend(BI.SliderIconButton.superclass._init.apply(this, arguments)); |
|
|
|
constants: { |
|
|
|
this.slider = BI.createWidget({ |
|
|
|
LARGE_SIZE: 16, |
|
|
|
type: "bi.text_button", |
|
|
|
NORMAL_SIZE: 12, |
|
|
|
cls: "slider-button", |
|
|
|
LARGE_OFFSET: 4, |
|
|
|
height: 12, |
|
|
|
NORMAL_OFFSET: 6 |
|
|
|
width: 12 |
|
|
|
}, |
|
|
|
}); |
|
|
|
|
|
|
|
BI.createWidget({ |
|
|
|
render: function () { |
|
|
|
|
|
|
|
var self = this; |
|
|
|
|
|
|
|
return { |
|
|
|
type: "bi.absolute", |
|
|
|
type: "bi.absolute", |
|
|
|
element: this, |
|
|
|
ref: function () { |
|
|
|
|
|
|
|
self.wrapper = this; |
|
|
|
|
|
|
|
}, |
|
|
|
items: [{ |
|
|
|
items: [{ |
|
|
|
el: this.slider, |
|
|
|
el: { |
|
|
|
top: 6, |
|
|
|
type: "bi.text_button", |
|
|
|
left: -6 |
|
|
|
cls: "slider-button", |
|
|
|
|
|
|
|
height: this.constants.NORMAL_SIZE, |
|
|
|
|
|
|
|
width: this.constants.NORMAL_SIZE, |
|
|
|
|
|
|
|
ref: function () { |
|
|
|
|
|
|
|
self.slider = this; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
top: this.constants.NORMAL_OFFSET, |
|
|
|
|
|
|
|
left: -8 |
|
|
|
}], |
|
|
|
}], |
|
|
|
width: 0, |
|
|
|
width: 0, |
|
|
|
height: 12 |
|
|
|
height: this.constants.NORMAL_SIZE |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mounted: function () { |
|
|
|
|
|
|
|
var self = this; |
|
|
|
|
|
|
|
this.slider.element.hover(function () { |
|
|
|
|
|
|
|
self._enlarge(); |
|
|
|
|
|
|
|
}, function () { |
|
|
|
|
|
|
|
self._normalize(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_enlarge: function () { |
|
|
|
|
|
|
|
this.slider.setWidth(this.constants.LARGE_SIZE); |
|
|
|
|
|
|
|
this.slider.setHeight(this.constants.LARGE_SIZE); |
|
|
|
|
|
|
|
this.wrapper.attr("items")[0].top = this.constants.LARGE_OFFSET; |
|
|
|
|
|
|
|
this.wrapper.attr("items")[0].left = -10; |
|
|
|
|
|
|
|
this.wrapper.resize(); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_normalize: function () { |
|
|
|
|
|
|
|
this.slider.setWidth(this.constants.NORMAL_SIZE); |
|
|
|
|
|
|
|
this.slider.setHeight(this.constants.NORMAL_SIZE); |
|
|
|
|
|
|
|
this.wrapper.attr("items")[0].top = this.constants.NORMAL_OFFSET; |
|
|
|
|
|
|
|
this.wrapper.attr("items")[0].left = -8; |
|
|
|
|
|
|
|
this.wrapper.resize(); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
BI.shortcut("bi.single_slider_button", BI.SliderIconButton);/** |
|
|
|
BI.shortcut("bi.single_slider_button", BI.SliderIconButton);/** |
|
|
@ -108597,6 +108634,7 @@ BI.SingleSlider = BI.inherit(BI.Widget, { |
|
|
|
hgap: c.SLIDER_WIDTH_HALF, |
|
|
|
hgap: c.SLIDER_WIDTH_HALF, |
|
|
|
height: c.SLIDER_HEIGHT |
|
|
|
height: c.SLIDER_HEIGHT |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
// 这边其实是有问题的,拖拽区域是个圆,在圆的边缘拖拽后放开,这边计算出来的蓝条宽度实际上会比放开时长一点或者短一点
|
|
|
|
sliderVertical.element.click(function (e) { |
|
|
|
sliderVertical.element.click(function (e) { |
|
|
|
if (self.enable && self.isEnabled()) { |
|
|
|
if (self.enable && self.isEnabled()) { |
|
|
|
var offset = e.clientX - self.element.offset().left - c.SLIDER_WIDTH_HALF; |
|
|
|
var offset = e.clientX - self.element.offset().left - c.SLIDER_WIDTH_HALF; |
|
|
|