Browse Source

Pull request #3105: KERNEL-12982 feat: [组件化] : BI.Popover提供控制能否拖动的能力

Merge in VISUAL/fineui from ~DAILER/fineui:master to master

* commit 'b5bd2cab66d670957e4cee0db41d0b0749fe89ab':
  KERNEL-12982 feat: [组件化] : BI.Popover提供控制能否拖动的能力
es6
Dailer-刘荣歆 2 years ago
parent
commit
d5a86dea0d
  1. 17
      src/base/layer/layer.popover.js

17
src/base/layer/layer.popover.js

@ -158,15 +158,17 @@ BI.Popover = BI.inherit(BI.Widget, {
mounted: function () {
var self = this;
this.dragger.element.mousedown(function (e) {
self.startX = self.element[0].offsetLeft;
self.startY = self.element[0].offsetTop;
self.tracker.captureMouseMoves(e);
if (self.options.draggable !== false) {
self.startX = self.element[0].offsetLeft;
self.startY = self.element[0].offsetTop;
self.tracker.captureMouseMoves(e);
}
});
},
_getSuitableBodyHeight: function (height) {
var o = this.options;
return BI.clamp(height, 0, BI.Widget._renderEngine.createElement("body")[0].clientHeight - o.headerHeight - (o.footer ? o.footerHeight : 0) - o.bodyTgap);
},
@ -207,6 +209,10 @@ BI.Popover = BI.inherit(BI.Widget, {
};
},
setDraggable: function (b) {
this.options.draggable = b;
},
hide: function () {
},
@ -224,9 +230,6 @@ BI.Popover = BI.inherit(BI.Widget, {
setZindex: function (zindex) {
this.element.css({ "z-index": zindex });
},
destroyed: function () {
},
});
BI.shortcut("bi.popover", BI.Popover);

Loading…
Cancel
Save