forked from fanruan/fineui
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.
94 lines
2.9 KiB
94 lines
2.9 KiB
8 years ago
|
/**
|
||
|
* Created by Young's on 2017/3/10.
|
||
|
*/
|
||
|
BI.RelationViewRegionContainer = BI.inherit(BI.Widget, {
|
||
|
_defaultConfig: function () {
|
||
|
return BI.extend(BI.RelationViewRegionContainer.superclass._defaultConfig.apply(this, arguments), {
|
||
|
baseCls: "bi-relation-view-region-container",
|
||
|
width: 150
|
||
|
});
|
||
|
},
|
||
|
|
||
|
_init: function () {
|
||
|
BI.RelationViewRegionContainer.superclass._init.apply(this, arguments);
|
||
|
var self = this, o = this.options;
|
||
|
this.region = BI.createWidget({
|
||
|
type: "bi.relation_view_region",
|
||
|
value: o.value,
|
||
|
header: o.header,
|
||
|
text: o.text,
|
||
|
handler: o.handler,
|
||
|
items: o.items,
|
||
|
belongPackage: o.belongPackage
|
||
|
});
|
||
|
this.region.on(BI.RelationViewRegion.EVENT_PREVIEW, function (v) {
|
||
|
self.fireEvent(BI.RelationViewRegionContainer.EVENT_PREVIEW, v);
|
||
|
});
|
||
|
this.region.on(BI.RelationViewRegion.EVENT_HOVER_IN, function (v) {
|
||
|
self.fireEvent(BI.RelationViewRegionContainer.EVENT_HOVER_IN, v);
|
||
|
});
|
||
|
this.region.on(BI.RelationViewRegion.EVENT_HOVER_OUT, function (v) {
|
||
|
self.fireEvent(BI.RelationViewRegionContainer.EVENT_HOVER_OUT, v);
|
||
|
});
|
||
|
BI.createWidget({
|
||
|
type: "bi.vertical",
|
||
|
element: this,
|
||
|
items: [this.region],
|
||
|
width: this.region.getWidth(),
|
||
|
height: this.region.getHeight()
|
||
|
});
|
||
|
},
|
||
|
|
||
|
doRedMark: function () {
|
||
|
this.region.doRedMark.apply(this.region, arguments);
|
||
|
},
|
||
|
|
||
|
unRedMark: function () {
|
||
|
this.region.unRedMark.apply(this.region, arguments);
|
||
|
},
|
||
|
|
||
|
getWidth: function () {
|
||
|
return this.region.getWidth();
|
||
|
},
|
||
|
|
||
|
getHeight: function () {
|
||
|
return this.region.getHeight();
|
||
|
},
|
||
|
|
||
|
//获取上方开始划线的位置
|
||
|
getTopLeftPosition: function () {
|
||
|
return this.region.getTopLeftPosition();
|
||
|
},
|
||
|
|
||
|
getTopRightPosition: function () {
|
||
|
return this.region.getTopRightPosition();
|
||
|
},
|
||
|
|
||
|
getBottomPosition: function () {
|
||
|
return this.region.getBottomPosition();
|
||
|
},
|
||
|
|
||
|
getLeftPosition: function () {
|
||
|
return this.region.getLeftPosition();
|
||
|
},
|
||
|
|
||
|
getRightPosition: function () {
|
||
|
return this.region.getRightPosition();
|
||
|
},
|
||
|
|
||
|
setValue: function (v) {
|
||
|
this.region.setValue(v);
|
||
|
},
|
||
|
|
||
|
toggleRegion: function (v) {
|
||
|
v === true ? this.region.element.fadeIn() : this.region.element.fadeOut();
|
||
|
},
|
||
|
|
||
|
setPreviewSelected: function(v) {
|
||
|
this.region.setPreviewSelected(v);
|
||
|
}
|
||
|
});
|
||
|
BI.RelationViewRegionContainer.EVENT_HOVER_IN = "RelationViewRegion.EVENT_HOVER_IN";
|
||
|
BI.RelationViewRegionContainer.EVENT_HOVER_OUT = "RelationViewRegion.EVENT_HOVER_OUT";
|
||
|
BI.RelationViewRegionContainer.EVENT_PREVIEW = "RelationViewRegion.EVENT_PREVIEW";
|
||
|
$.shortcut("bi.relation_view_region_container", BI.RelationViewRegionContainer);
|