|
|
@ -50,22 +50,24 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
|
|
|
|
|
|
|
|
render: function () { |
|
|
|
render: function () { |
|
|
|
var self = this, o = this.options; |
|
|
|
var self = this, o = this.options; |
|
|
|
var fn = function (e) { |
|
|
|
function fn (e) { |
|
|
|
e.stopPropagation(); |
|
|
|
e.stopPropagation(); |
|
|
|
}, stop = function (e) { |
|
|
|
} |
|
|
|
|
|
|
|
function stop (e) { |
|
|
|
e.stopEvent(); |
|
|
|
e.stopEvent(); |
|
|
|
|
|
|
|
|
|
|
|
return false; |
|
|
|
return false; |
|
|
|
}; |
|
|
|
} |
|
|
|
this.element.css({ |
|
|
|
this.element.css({ |
|
|
|
"z-index": BI.zIndex_popup, |
|
|
|
"z-index": BI.zIndex_popup, |
|
|
|
"min-width": BI.isNumeric(o.minWidth) ? (o.minWidth / BI.pixRatio + BI.pixUnit) : o.minWidth, |
|
|
|
"min-width": BI.isNumeric(o.minWidth) ? (o.minWidth / BI.pixRatio + BI.pixUnit) : o.minWidth, |
|
|
|
"max-width": BI.isNumeric(o.maxWidth) ? (o.maxWidth / BI.pixRatio + BI.pixUnit) : o.maxWidth |
|
|
|
"max-width": BI.isNumeric(o.maxWidth) ? (o.maxWidth / BI.pixRatio + BI.pixUnit) : o.maxWidth |
|
|
|
}).bind({click: fn}); |
|
|
|
}).bind({ click: fn }); |
|
|
|
|
|
|
|
|
|
|
|
this.element.bind("mousewheel", fn); |
|
|
|
this.element.bind("mousewheel", fn); |
|
|
|
|
|
|
|
|
|
|
|
o.stopPropagation && this.element.bind({mousedown: fn, mouseup: fn, mouseover: fn}); |
|
|
|
o.stopPropagation && this.element.bind({ mousedown: fn, mouseup: fn, mouseover: fn }); |
|
|
|
o.stopEvent && this.element.bind({mousedown: stop, mouseup: stop, mouseover: stop}); |
|
|
|
o.stopEvent && this.element.bind({ mousedown: stop, mouseup: stop, mouseover: stop }); |
|
|
|
this.tool = this._createTool(); |
|
|
|
this.tool = this._createTool(); |
|
|
|
this.tab = this._createTab(); |
|
|
|
this.tab = this._createTab(); |
|
|
|
this.view = this._createView(); |
|
|
|
this.view = this._createView(); |
|
|
@ -108,7 +110,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
type: "bi.absolute", |
|
|
|
type: "bi.absolute", |
|
|
|
cls: "bi-bubble-arrow-wrapper", |
|
|
|
cls: "bi-bubble-arrow-wrapper", |
|
|
|
items: [{ |
|
|
|
items: [{ |
|
|
|
el: this.arrow, |
|
|
|
el: this.arrow |
|
|
|
}] |
|
|
|
}] |
|
|
|
}); |
|
|
|
}); |
|
|
|
// 因为三角符号的原因位置变大了,需要占位
|
|
|
|
// 因为三角符号的原因位置变大了,需要占位
|
|
|
@ -121,7 +123,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
items: [{ |
|
|
|
items: [{ |
|
|
|
el: this.arrowWrapper, |
|
|
|
el: this.arrowWrapper, |
|
|
|
left: 0, |
|
|
|
left: 0, |
|
|
|
top: 0, |
|
|
|
top: 0 |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
el: this.placeholder |
|
|
|
el: this.placeholder |
|
|
|
}] |
|
|
|
}] |
|
|
@ -131,7 +133,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
|
|
|
|
|
|
|
|
_createView: function () { |
|
|
|
_createView: function () { |
|
|
|
var o = this.options; |
|
|
|
var o = this.options; |
|
|
|
this.button_group = BI.createWidget(o.el, {type: "bi.button_group", value: o.value}); |
|
|
|
this.button_group = BI.createWidget(o.el, { type: "bi.button_group", value: o.value }); |
|
|
|
this.button_group.element.css({ |
|
|
|
this.button_group.element.css({ |
|
|
|
"min-height": BI.isNumeric(o.minHeight) ? (o.minHeight / BI.pixRatio + BI.pixUnit) : o.minHeight, |
|
|
|
"min-height": BI.isNumeric(o.minHeight) ? (o.minHeight / BI.pixRatio + BI.pixUnit) : o.minHeight, |
|
|
|
"padding-top": o.innerVgap / BI.pixRatio + BI.pixUnit, |
|
|
|
"padding-top": o.innerVgap / BI.pixRatio + BI.pixUnit, |
|
|
@ -139,6 +141,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
"padding-left": o.innerHgap / BI.pixRatio + BI.pixUnit, |
|
|
|
"padding-left": o.innerHgap / BI.pixRatio + BI.pixUnit, |
|
|
|
"padding-right": o.innerHgap / BI.pixRatio + BI.pixUnit |
|
|
|
"padding-right": o.innerHgap / BI.pixRatio + BI.pixUnit |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
return this.button_group; |
|
|
|
return this.button_group; |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -147,6 +150,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
if (false === o.tool) { |
|
|
|
if (false === o.tool) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return BI.createWidget(o.tool); |
|
|
|
return BI.createWidget(o.tool); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -155,6 +159,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
if (o.tabs.length === 0) { |
|
|
|
if (o.tabs.length === 0) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return BI.createWidget({ |
|
|
|
return BI.createWidget({ |
|
|
|
type: "bi.center", |
|
|
|
type: "bi.center", |
|
|
|
cls: "list-view-tab", |
|
|
|
cls: "list-view-tab", |
|
|
@ -218,7 +223,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
top: o.tgap + o.vgap, |
|
|
|
top: o.tgap + o.vgap, |
|
|
|
left: 0, |
|
|
|
left: 0, |
|
|
|
right: "", |
|
|
|
right: "", |
|
|
|
bottom: "", |
|
|
|
bottom: "" |
|
|
|
}; |
|
|
|
}; |
|
|
|
placeholderStyle = { |
|
|
|
placeholderStyle = { |
|
|
|
left: 0, |
|
|
|
left: 0, |
|
|
@ -237,7 +242,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
top: o.bgap + o.vgap, |
|
|
|
top: o.bgap + o.vgap, |
|
|
|
left: "", |
|
|
|
left: "", |
|
|
|
right: 0, |
|
|
|
right: 0, |
|
|
|
bottom: "", |
|
|
|
bottom: "" |
|
|
|
}; |
|
|
|
}; |
|
|
|
placeholderStyle = { |
|
|
|
placeholderStyle = { |
|
|
|
left: 0, |
|
|
|
left: 0, |
|
|
@ -257,14 +262,14 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
bottom: o.bgap + o.vgap, |
|
|
|
bottom: o.bgap + o.vgap, |
|
|
|
left: 0, |
|
|
|
left: 0, |
|
|
|
right: "", |
|
|
|
right: "", |
|
|
|
top: "", |
|
|
|
top: "" |
|
|
|
}; |
|
|
|
}; |
|
|
|
placeholderStyle = { |
|
|
|
placeholderStyle = { |
|
|
|
left: 0, |
|
|
|
left: 0, |
|
|
|
right: 0, |
|
|
|
right: 0, |
|
|
|
height: this._const.TRIANGLE_LENGTH, |
|
|
|
height: this._const.TRIANGLE_LENGTH, |
|
|
|
top: "", |
|
|
|
top: "", |
|
|
|
bottom: -this._const.TRIANGLE_LENGTH, |
|
|
|
bottom: -this._const.TRIANGLE_LENGTH |
|
|
|
}; |
|
|
|
}; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "top,left": |
|
|
|
case "top,left": |
|
|
@ -276,14 +281,14 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
bottom: o.bgap + o.vgap, |
|
|
|
bottom: o.bgap + o.vgap, |
|
|
|
right: 0, |
|
|
|
right: 0, |
|
|
|
left: "", |
|
|
|
left: "", |
|
|
|
top: "", |
|
|
|
top: "" |
|
|
|
}; |
|
|
|
}; |
|
|
|
placeholderStyle = { |
|
|
|
placeholderStyle = { |
|
|
|
left: 0, |
|
|
|
left: 0, |
|
|
|
right: 0, |
|
|
|
right: 0, |
|
|
|
height: this._const.TRIANGLE_LENGTH, |
|
|
|
height: this._const.TRIANGLE_LENGTH, |
|
|
|
top: "", |
|
|
|
top: "", |
|
|
|
bottom: -this._const.TRIANGLE_LENGTH, |
|
|
|
bottom: -this._const.TRIANGLE_LENGTH |
|
|
|
}; |
|
|
|
}; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "left": |
|
|
|
case "left": |
|
|
@ -296,7 +301,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
right: o.rgap + o.hgap, |
|
|
|
right: o.rgap + o.hgap, |
|
|
|
top: 0, |
|
|
|
top: 0, |
|
|
|
bottom: "", |
|
|
|
bottom: "", |
|
|
|
left: "", |
|
|
|
left: "" |
|
|
|
}; |
|
|
|
}; |
|
|
|
placeholderStyle = { |
|
|
|
placeholderStyle = { |
|
|
|
top: 0, |
|
|
|
top: 0, |
|
|
@ -315,7 +320,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
right: o.rgap + o.hgap, |
|
|
|
right: o.rgap + o.hgap, |
|
|
|
bottom: 0, |
|
|
|
bottom: 0, |
|
|
|
top: "", |
|
|
|
top: "", |
|
|
|
left: "", |
|
|
|
left: "" |
|
|
|
}; |
|
|
|
}; |
|
|
|
placeholderStyle = { |
|
|
|
placeholderStyle = { |
|
|
|
top: 0, |
|
|
|
top: 0, |
|
|
@ -335,7 +340,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
left: o.lgap + o.hgap, |
|
|
|
left: o.lgap + o.hgap, |
|
|
|
top: 0, |
|
|
|
top: 0, |
|
|
|
bottom: "", |
|
|
|
bottom: "", |
|
|
|
right: "", |
|
|
|
right: "" |
|
|
|
}; |
|
|
|
}; |
|
|
|
placeholderStyle = { |
|
|
|
placeholderStyle = { |
|
|
|
top: 0, |
|
|
|
top: 0, |
|
|
@ -354,7 +359,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
left: o.lgap + o.hgap, |
|
|
|
left: o.lgap + o.hgap, |
|
|
|
bottom: 0, |
|
|
|
bottom: 0, |
|
|
|
top: "", |
|
|
|
top: "", |
|
|
|
right: "", |
|
|
|
right: "" |
|
|
|
}; |
|
|
|
}; |
|
|
|
placeholderStyle = { |
|
|
|
placeholderStyle = { |
|
|
|
top: 0, |
|
|
|
top: 0, |
|
|
@ -372,8 +377,15 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
break; |
|
|
|
break; |
|
|
|
case "innerLeft": |
|
|
|
case "innerLeft": |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
this.element.removeClass("left").removeClass("right").removeClass("top").removeClass("bottom").addClass(direction); |
|
|
|
this.element |
|
|
|
|
|
|
|
.removeClass("left") |
|
|
|
|
|
|
|
.removeClass("right") |
|
|
|
|
|
|
|
.removeClass("top") |
|
|
|
|
|
|
|
.removeClass("bottom") |
|
|
|
|
|
|
|
.addClass(direction); |
|
|
|
this.arrow.element.css(style); |
|
|
|
this.arrow.element.css(style); |
|
|
|
this.arrowWrapper.element.css(wrapperStyle); |
|
|
|
this.arrowWrapper.element.css(wrapperStyle); |
|
|
|
this.placeholder.element.css(placeholderStyle); |
|
|
|
this.placeholder.element.css(placeholderStyle); |
|
|
@ -399,7 +411,7 @@ BI.PopupView = BI.inherit(BI.Widget, { |
|
|
|
toolHeight = ((this.tool && this.tool.attr("height")) || 24) * ((this.tool && this.tool.isVisible()) ? 1 : 0); |
|
|
|
toolHeight = ((this.tool && this.tool.attr("height")) || 24) * ((this.tool && this.tool.isVisible()) ? 1 : 0); |
|
|
|
var resetHeight = h - tbHeight - tabHeight - toolHeight - 2 * this.options.innerVgap; |
|
|
|
var resetHeight = h - tbHeight - tabHeight - toolHeight - 2 * this.options.innerVgap; |
|
|
|
this.view.resetHeight ? this.view.resetHeight(resetHeight) : |
|
|
|
this.view.resetHeight ? this.view.resetHeight(resetHeight) : |
|
|
|
this.view.element.css({"max-height": resetHeight / BI.pixRatio + BI.pixUnit}); |
|
|
|
this.view.element.css({ "max-height": resetHeight / BI.pixRatio + BI.pixUnit }); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (selectedValues) { |
|
|
|
setValue: function (selectedValues) { |
|
|
|