Browse Source

update

master
guy 7 years ago
parent
commit
a91628c837
  1. 8
      demo/js/core/popup/demo.popover.js
  2. 34
      dist/base.js
  3. 70
      dist/bundle.js
  4. 16
      dist/bundle.min.js
  5. 36
      dist/core.js
  6. 8
      dist/demo.js
  7. 70
      dist/fineui.js
  8. 10
      dist/fineui.min.js
  9. 2
      src/base/base.js
  10. 32
      src/base/layer/layer.popover.js
  11. 34
      src/core/controller/controller.floatbox.js
  12. 2
      src/core/var.js
  13. 2
      src/less/var.less
  14. 2
      utils/utils.js

8
demo/js/core/popup/demo.popover.js

@ -15,9 +15,17 @@ Demo.Func = BI.inherit(BI.Widget, {
handler: function() {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
},
footer: {
type: "bi.label",
text: "这个是footer"
}
}).open(id);
}

34
dist/base.js vendored

@ -2488,7 +2488,7 @@ BI.Layers = new BI.LayerController();
BI.Maskers = new BI.MaskersController();
BI.Bubbles = new BI.BubblesController();
BI.Tooltips = new BI.TooltipsController();
BI.Popovers = new BI.FloatBoxController();
BI.Popovers = new BI.PopoverController();
BI.Broadcasts = new BI.BroadcastController();
BI.StyleLoaders = new BI.StyleLoaderManager();/**
* canvas绘图
@ -15302,13 +15302,13 @@ BI.GridView = BI.inherit(BI.Widget, {
});
BI.GridView.EVENT_SCROLL = "EVENT_SCROLL";
BI.shortcut("bi.grid_view", BI.GridView);/**
* floatBox弹出层
* @class BI.FloatBox
* Popover弹出层
* @class BI.Popover
* @extends BI.Widget
*/
BI.FloatBox = BI.inherit(BI.Widget, {
BI.Popover = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-float-box bi-card",
width: 600,
height: 500,
@ -15418,12 +15418,12 @@ BI.FloatBox = BI.inherit(BI.Widget, {
open: function () {
this.show();
this.fireEvent(BI.FloatBox.EVENT_OPEN);
this.fireEvent(BI.Popover.EVENT_OPEN);
},
close: function () {
this.hide();
this.fireEvent(BI.FloatBox.EVENT_CLOSE);
this.fireEvent(BI.Popover.EVENT_CLOSE);
},
setZindex: function (zindex) {
@ -15434,11 +15434,11 @@ BI.FloatBox = BI.inherit(BI.Widget, {
}
});
BI.shortcut("bi.float_box", BI.FloatBox);
BI.shortcut("bi.popover", BI.Popover);
BI.BarFloatBox = BI.inherit(BI.FloatBox, {
BI.BarPopover = BI.inherit(BI.Popover, {
_defaultConfig: function () {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText(BI.i18nText("BI-Basic_Cancel"))]
});
},
@ -15454,7 +15454,7 @@ BI.BarFloatBox = BI.inherit(BI.FloatBox, {
value: 1,
level: "ignore",
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CANCEL, v);
self.fireEvent(BI.Popover.EVENT_CANCEL, v);
self.close(v);
}
}, {
@ -15463,7 +15463,7 @@ BI.BarFloatBox = BI.inherit(BI.FloatBox, {
warningTitle: o.warningTitle,
value: 0,
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CONFIRM, v);
self.fireEvent(BI.Popover.EVENT_CONFIRM, v);
self.close(v);
}
}]
@ -15471,12 +15471,12 @@ BI.BarFloatBox = BI.inherit(BI.FloatBox, {
}
});
BI.shortcut("bi.bar_float_box", BI.BarFloatBox);
BI.shortcut("bi.bar_popover", BI.BarPopover);
BI.FloatBox.EVENT_CLOSE = "EVENT_CLOSE";
BI.FloatBox.EVENT_OPEN = "EVENT_OPEN";
BI.FloatBox.EVENT_CANCEL = "EVENT_CANCEL";
BI.FloatBox.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.Popover.EVENT_CLOSE = "EVENT_CLOSE";
BI.Popover.EVENT_OPEN = "EVENT_OPEN";
BI.Popover.EVENT_CANCEL = "EVENT_CANCEL";
BI.Popover.EVENT_CONFIRM = "EVENT_CONFIRM";
/**
* 下拉框弹出层, zIndex在1000w
* @class BI.PopupView

70
dist/bundle.js vendored

@ -26546,26 +26546,26 @@ BI.BubblesController = BI.inherit(BI.Controller, {
}
});/**
* guy
* FloatBox弹出层控制器, z-index在100w层级
* @class BI.FloatBoxController
* popover弹出层控制器, z-index在100w层级
* @class BI.popoverController
* @extends BI.Controller
*/
BI.FloatBoxController = BI.inherit(BI.Controller, {
BI.PopoverController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.FloatBoxController.superclass._defaultConfig.apply(this, arguments), {
return BI.extend(BI.PopoverController.superclass._defaultConfig.apply(this, arguments), {
modal: true, // 模态窗口
render: "body"
});
},
_init: function () {
BI.FloatBoxController.superclass._init.apply(this, arguments);
BI.PopoverController.superclass._init.apply(this, arguments);
this.modal = this.options.modal;
this.floatManager = {};
this.floatLayer = {};
this.floatContainer = {};
this.floatOpened = {};
this.zindex = BI.zIndex_floatbox;
this.zindex = BI.zIndex_popover;
this.zindexMap = {};
},
@ -26577,14 +26577,14 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
if (this._check(name)) {
return this;
}
var floatbox = BI.createWidget({
type: "bi.float_box"
var popover = BI.createWidget({
type: "bi.popover"
}, options, context);
this.add(name, floatbox, options, context);
this.add(name, popover, options, context);
return this;
},
add: function (name, floatbox, options, context) {
add: function (name, popover, options, context) {
var self = this;
options || (options = {});
if (this._check(name)) {
@ -26596,7 +26596,7 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
items: [{
el: (this.floatLayer[name] = BI.createWidget({
type: "bi.absolute",
items: [floatbox]
items: [popover]
}, context)),
left: 0,
right: 0,
@ -26604,9 +26604,9 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
bottom: 0
}]
});
this.floatManager[name] = floatbox;
this.floatManager[name] = popover;
(function (key) {
floatbox.on(BI.FloatBox.EVENT_CLOSE, function () {
popover.on(BI.Popover.EVENT_CLOSE, function () {
self.close(key);
});
})(name);
@ -26637,10 +26637,10 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
this.modal && container.element.__buildZIndexMask__(this.zindex++);
this.get(name).setZindex(this.zindex++);
this.floatContainer[name].visible();
var floatbox = this.get(name);
floatbox.show && floatbox.show();
var popover = this.get(name);
popover.show && popover.show();
var W = $(this.options.render).width(), H = $(this.options.render).height();
var w = floatbox.element.width(), h = floatbox.element.height();
var w = popover.element.width(), h = popover.element.height();
var left = (W - w) / 2, top = (H - h) / 2;
if (left < 0) {
left = 0;
@ -26648,7 +26648,7 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
if (top < 0) {
top = 0;
}
floatbox.element.css({
popover.element.css({
left: left + "px",
top: top + "px"
});
@ -30063,7 +30063,7 @@ _.extend(BI, {
MIN: -0xfffffffffffffff,
EVENT_RESPONSE_TIME: 200,
zIndex_layer: 1e5,
zIndex_floatbox: 1e6,
zIndex_popover: 1e6,
zIndex_popup: 1e7,
zIndex_masker: 1e8,
zIndex_tip: 1e9,
@ -36315,7 +36315,7 @@ BI.Layers = new BI.LayerController();
BI.Maskers = new BI.MaskersController();
BI.Bubbles = new BI.BubblesController();
BI.Tooltips = new BI.TooltipsController();
BI.Popovers = new BI.FloatBoxController();
BI.Popovers = new BI.PopoverController();
BI.Broadcasts = new BI.BroadcastController();
BI.StyleLoaders = new BI.StyleLoaderManager();/**
* canvas绘图
@ -49129,13 +49129,13 @@ BI.GridView = BI.inherit(BI.Widget, {
});
BI.GridView.EVENT_SCROLL = "EVENT_SCROLL";
BI.shortcut("bi.grid_view", BI.GridView);/**
* floatBox弹出层
* @class BI.FloatBox
* Popover弹出层
* @class BI.Popover
* @extends BI.Widget
*/
BI.FloatBox = BI.inherit(BI.Widget, {
BI.Popover = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-float-box bi-card",
width: 600,
height: 500,
@ -49245,12 +49245,12 @@ BI.FloatBox = BI.inherit(BI.Widget, {
open: function () {
this.show();
this.fireEvent(BI.FloatBox.EVENT_OPEN);
this.fireEvent(BI.Popover.EVENT_OPEN);
},
close: function () {
this.hide();
this.fireEvent(BI.FloatBox.EVENT_CLOSE);
this.fireEvent(BI.Popover.EVENT_CLOSE);
},
setZindex: function (zindex) {
@ -49261,11 +49261,11 @@ BI.FloatBox = BI.inherit(BI.Widget, {
}
});
BI.shortcut("bi.float_box", BI.FloatBox);
BI.shortcut("bi.popover", BI.Popover);
BI.BarFloatBox = BI.inherit(BI.FloatBox, {
BI.BarPopover = BI.inherit(BI.Popover, {
_defaultConfig: function () {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText(BI.i18nText("BI-Basic_Cancel"))]
});
},
@ -49281,7 +49281,7 @@ BI.BarFloatBox = BI.inherit(BI.FloatBox, {
value: 1,
level: "ignore",
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CANCEL, v);
self.fireEvent(BI.Popover.EVENT_CANCEL, v);
self.close(v);
}
}, {
@ -49290,7 +49290,7 @@ BI.BarFloatBox = BI.inherit(BI.FloatBox, {
warningTitle: o.warningTitle,
value: 0,
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CONFIRM, v);
self.fireEvent(BI.Popover.EVENT_CONFIRM, v);
self.close(v);
}
}]
@ -49298,12 +49298,12 @@ BI.BarFloatBox = BI.inherit(BI.FloatBox, {
}
});
BI.shortcut("bi.bar_float_box", BI.BarFloatBox);
BI.shortcut("bi.bar_popover", BI.BarPopover);
BI.FloatBox.EVENT_CLOSE = "EVENT_CLOSE";
BI.FloatBox.EVENT_OPEN = "EVENT_OPEN";
BI.FloatBox.EVENT_CANCEL = "EVENT_CANCEL";
BI.FloatBox.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.Popover.EVENT_CLOSE = "EVENT_CLOSE";
BI.Popover.EVENT_OPEN = "EVENT_OPEN";
BI.Popover.EVENT_CANCEL = "EVENT_CANCEL";
BI.Popover.EVENT_CONFIRM = "EVENT_CONFIRM";
/**
* 下拉框弹出层, zIndex在1000w
* @class BI.PopupView

16
dist/bundle.min.js vendored

File diff suppressed because one or more lines are too long

36
dist/core.js vendored

@ -26546,26 +26546,26 @@ BI.BubblesController = BI.inherit(BI.Controller, {
}
});/**
* guy
* FloatBox弹出层控制器, z-index在100w层级
* @class BI.FloatBoxController
* popover弹出层控制器, z-index在100w层级
* @class BI.popoverController
* @extends BI.Controller
*/
BI.FloatBoxController = BI.inherit(BI.Controller, {
BI.PopoverController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.FloatBoxController.superclass._defaultConfig.apply(this, arguments), {
return BI.extend(BI.PopoverController.superclass._defaultConfig.apply(this, arguments), {
modal: true, // 模态窗口
render: "body"
});
},
_init: function () {
BI.FloatBoxController.superclass._init.apply(this, arguments);
BI.PopoverController.superclass._init.apply(this, arguments);
this.modal = this.options.modal;
this.floatManager = {};
this.floatLayer = {};
this.floatContainer = {};
this.floatOpened = {};
this.zindex = BI.zIndex_floatbox;
this.zindex = BI.zIndex_popover;
this.zindexMap = {};
},
@ -26577,14 +26577,14 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
if (this._check(name)) {
return this;
}
var floatbox = BI.createWidget({
type: "bi.float_box"
var popover = BI.createWidget({
type: "bi.popover"
}, options, context);
this.add(name, floatbox, options, context);
this.add(name, popover, options, context);
return this;
},
add: function (name, floatbox, options, context) {
add: function (name, popover, options, context) {
var self = this;
options || (options = {});
if (this._check(name)) {
@ -26596,7 +26596,7 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
items: [{
el: (this.floatLayer[name] = BI.createWidget({
type: "bi.absolute",
items: [floatbox]
items: [popover]
}, context)),
left: 0,
right: 0,
@ -26604,9 +26604,9 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
bottom: 0
}]
});
this.floatManager[name] = floatbox;
this.floatManager[name] = popover;
(function (key) {
floatbox.on(BI.FloatBox.EVENT_CLOSE, function () {
popover.on(BI.Popover.EVENT_CLOSE, function () {
self.close(key);
});
})(name);
@ -26637,10 +26637,10 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
this.modal && container.element.__buildZIndexMask__(this.zindex++);
this.get(name).setZindex(this.zindex++);
this.floatContainer[name].visible();
var floatbox = this.get(name);
floatbox.show && floatbox.show();
var popover = this.get(name);
popover.show && popover.show();
var W = $(this.options.render).width(), H = $(this.options.render).height();
var w = floatbox.element.width(), h = floatbox.element.height();
var w = popover.element.width(), h = popover.element.height();
var left = (W - w) / 2, top = (H - h) / 2;
if (left < 0) {
left = 0;
@ -26648,7 +26648,7 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
if (top < 0) {
top = 0;
}
floatbox.element.css({
popover.element.css({
left: left + "px",
top: top + "px"
});
@ -30063,7 +30063,7 @@ _.extend(BI, {
MIN: -0xfffffffffffffff,
EVENT_RESPONSE_TIME: 200,
zIndex_layer: 1e5,
zIndex_floatbox: 1e6,
zIndex_popover: 1e6,
zIndex_popup: 1e7,
zIndex_masker: 1e8,
zIndex_tip: 1e9,

8
dist/demo.js vendored

@ -8475,9 +8475,17 @@ Demo.Func = BI.inherit(BI.Widget, {
handler: function() {
BI.Popovers.remove(id);
BI.Popovers.create(id, {
header: {
type: "bi.label",
text: "这个是header"
},
body: {
type: "bi.label",
text: "这个是body"
},
footer: {
type: "bi.label",
text: "这个是footer"
}
}).open(id);
}

70
dist/fineui.js vendored

@ -26789,26 +26789,26 @@ BI.BubblesController = BI.inherit(BI.Controller, {
}
});/**
* guy
* FloatBox弹出层控制器, z-index在100w层级
* @class BI.FloatBoxController
* popover弹出层控制器, z-index在100w层级
* @class BI.popoverController
* @extends BI.Controller
*/
BI.FloatBoxController = BI.inherit(BI.Controller, {
BI.PopoverController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.FloatBoxController.superclass._defaultConfig.apply(this, arguments), {
return BI.extend(BI.PopoverController.superclass._defaultConfig.apply(this, arguments), {
modal: true, // 模态窗口
render: "body"
});
},
_init: function () {
BI.FloatBoxController.superclass._init.apply(this, arguments);
BI.PopoverController.superclass._init.apply(this, arguments);
this.modal = this.options.modal;
this.floatManager = {};
this.floatLayer = {};
this.floatContainer = {};
this.floatOpened = {};
this.zindex = BI.zIndex_floatbox;
this.zindex = BI.zIndex_popover;
this.zindexMap = {};
},
@ -26820,14 +26820,14 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
if (this._check(name)) {
return this;
}
var floatbox = BI.createWidget({
type: "bi.float_box"
var popover = BI.createWidget({
type: "bi.popover"
}, options, context);
this.add(name, floatbox, options, context);
this.add(name, popover, options, context);
return this;
},
add: function (name, floatbox, options, context) {
add: function (name, popover, options, context) {
var self = this;
options || (options = {});
if (this._check(name)) {
@ -26839,7 +26839,7 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
items: [{
el: (this.floatLayer[name] = BI.createWidget({
type: "bi.absolute",
items: [floatbox]
items: [popover]
}, context)),
left: 0,
right: 0,
@ -26847,9 +26847,9 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
bottom: 0
}]
});
this.floatManager[name] = floatbox;
this.floatManager[name] = popover;
(function (key) {
floatbox.on(BI.FloatBox.EVENT_CLOSE, function () {
popover.on(BI.Popover.EVENT_CLOSE, function () {
self.close(key);
});
})(name);
@ -26880,10 +26880,10 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
this.modal && container.element.__buildZIndexMask__(this.zindex++);
this.get(name).setZindex(this.zindex++);
this.floatContainer[name].visible();
var floatbox = this.get(name);
floatbox.show && floatbox.show();
var popover = this.get(name);
popover.show && popover.show();
var W = $(this.options.render).width(), H = $(this.options.render).height();
var w = floatbox.element.width(), h = floatbox.element.height();
var w = popover.element.width(), h = popover.element.height();
var left = (W - w) / 2, top = (H - h) / 2;
if (left < 0) {
left = 0;
@ -26891,7 +26891,7 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
if (top < 0) {
top = 0;
}
floatbox.element.css({
popover.element.css({
left: left + "px",
top: top + "px"
});
@ -30306,7 +30306,7 @@ _.extend(BI, {
MIN: -0xfffffffffffffff,
EVENT_RESPONSE_TIME: 200,
zIndex_layer: 1e5,
zIndex_floatbox: 1e6,
zIndex_popover: 1e6,
zIndex_popup: 1e7,
zIndex_masker: 1e8,
zIndex_tip: 1e9,
@ -38121,7 +38121,7 @@ BI.Layers = new BI.LayerController();
BI.Maskers = new BI.MaskersController();
BI.Bubbles = new BI.BubblesController();
BI.Tooltips = new BI.TooltipsController();
BI.Popovers = new BI.FloatBoxController();
BI.Popovers = new BI.PopoverController();
BI.Broadcasts = new BI.BroadcastController();
BI.StyleLoaders = new BI.StyleLoaderManager();/**
* canvas绘图
@ -50935,13 +50935,13 @@ BI.GridView = BI.inherit(BI.Widget, {
});
BI.GridView.EVENT_SCROLL = "EVENT_SCROLL";
BI.shortcut("bi.grid_view", BI.GridView);/**
* floatBox弹出层
* @class BI.FloatBox
* Popover弹出层
* @class BI.Popover
* @extends BI.Widget
*/
BI.FloatBox = BI.inherit(BI.Widget, {
BI.Popover = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-float-box bi-card",
width: 600,
height: 500,
@ -51051,12 +51051,12 @@ BI.FloatBox = BI.inherit(BI.Widget, {
open: function () {
this.show();
this.fireEvent(BI.FloatBox.EVENT_OPEN);
this.fireEvent(BI.Popover.EVENT_OPEN);
},
close: function () {
this.hide();
this.fireEvent(BI.FloatBox.EVENT_CLOSE);
this.fireEvent(BI.Popover.EVENT_CLOSE);
},
setZindex: function (zindex) {
@ -51067,11 +51067,11 @@ BI.FloatBox = BI.inherit(BI.Widget, {
}
});
BI.shortcut("bi.float_box", BI.FloatBox);
BI.shortcut("bi.popover", BI.Popover);
BI.BarFloatBox = BI.inherit(BI.FloatBox, {
BI.BarPopover = BI.inherit(BI.Popover, {
_defaultConfig: function () {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText(BI.i18nText("BI-Basic_Cancel"))]
});
},
@ -51087,7 +51087,7 @@ BI.BarFloatBox = BI.inherit(BI.FloatBox, {
value: 1,
level: "ignore",
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CANCEL, v);
self.fireEvent(BI.Popover.EVENT_CANCEL, v);
self.close(v);
}
}, {
@ -51096,7 +51096,7 @@ BI.BarFloatBox = BI.inherit(BI.FloatBox, {
warningTitle: o.warningTitle,
value: 0,
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CONFIRM, v);
self.fireEvent(BI.Popover.EVENT_CONFIRM, v);
self.close(v);
}
}]
@ -51104,12 +51104,12 @@ BI.BarFloatBox = BI.inherit(BI.FloatBox, {
}
});
BI.shortcut("bi.bar_float_box", BI.BarFloatBox);
BI.shortcut("bi.bar_popover", BI.BarPopover);
BI.FloatBox.EVENT_CLOSE = "EVENT_CLOSE";
BI.FloatBox.EVENT_OPEN = "EVENT_OPEN";
BI.FloatBox.EVENT_CANCEL = "EVENT_CANCEL";
BI.FloatBox.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.Popover.EVENT_CLOSE = "EVENT_CLOSE";
BI.Popover.EVENT_OPEN = "EVENT_OPEN";
BI.Popover.EVENT_CANCEL = "EVENT_CANCEL";
BI.Popover.EVENT_CONFIRM = "EVENT_CONFIRM";
/**
* 下拉框弹出层, zIndex在1000w
* @class BI.PopupView

10
dist/fineui.min.js vendored

File diff suppressed because one or more lines are too long

2
src/base/base.js

@ -3,6 +3,6 @@ BI.Layers = new BI.LayerController();
BI.Maskers = new BI.MaskersController();
BI.Bubbles = new BI.BubblesController();
BI.Tooltips = new BI.TooltipsController();
BI.Popovers = new BI.FloatBoxController();
BI.Popovers = new BI.PopoverController();
BI.Broadcasts = new BI.BroadcastController();
BI.StyleLoaders = new BI.StyleLoaderManager();

32
src/base/layer/layer.floatbox.js → src/base/layer/layer.popover.js

@ -1,11 +1,11 @@
/**
* floatBox弹出层
* @class BI.FloatBox
* Popover弹出层
* @class BI.Popover
* @extends BI.Widget
*/
BI.FloatBox = BI.inherit(BI.Widget, {
BI.Popover = BI.inherit(BI.Widget, {
_defaultConfig: function () {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
baseCls: "bi-float-box bi-card",
width: 600,
height: 500,
@ -115,12 +115,12 @@ BI.FloatBox = BI.inherit(BI.Widget, {
open: function () {
this.show();
this.fireEvent(BI.FloatBox.EVENT_OPEN);
this.fireEvent(BI.Popover.EVENT_OPEN);
},
close: function () {
this.hide();
this.fireEvent(BI.FloatBox.EVENT_CLOSE);
this.fireEvent(BI.Popover.EVENT_CLOSE);
},
setZindex: function (zindex) {
@ -131,11 +131,11 @@ BI.FloatBox = BI.inherit(BI.Widget, {
}
});
BI.shortcut("bi.float_box", BI.FloatBox);
BI.shortcut("bi.popover", BI.Popover);
BI.BarFloatBox = BI.inherit(BI.FloatBox, {
BI.BarPopover = BI.inherit(BI.Popover, {
_defaultConfig: function () {
return BI.extend(BI.FloatBox.superclass._defaultConfig.apply(this, arguments), {
return BI.extend(BI.Popover.superclass._defaultConfig.apply(this, arguments), {
btns: [BI.i18nText(BI.i18nText("BI-Basic_Sure")), BI.i18nText(BI.i18nText("BI-Basic_Cancel"))]
});
},
@ -151,7 +151,7 @@ BI.BarFloatBox = BI.inherit(BI.FloatBox, {
value: 1,
level: "ignore",
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CANCEL, v);
self.fireEvent(BI.Popover.EVENT_CANCEL, v);
self.close(v);
}
}, {
@ -160,7 +160,7 @@ BI.BarFloatBox = BI.inherit(BI.FloatBox, {
warningTitle: o.warningTitle,
value: 0,
handler: function (v) {
self.fireEvent(BI.FloatBox.EVENT_CONFIRM, v);
self.fireEvent(BI.Popover.EVENT_CONFIRM, v);
self.close(v);
}
}]
@ -168,9 +168,9 @@ BI.BarFloatBox = BI.inherit(BI.FloatBox, {
}
});
BI.shortcut("bi.bar_float_box", BI.BarFloatBox);
BI.shortcut("bi.bar_popover", BI.BarPopover);
BI.FloatBox.EVENT_CLOSE = "EVENT_CLOSE";
BI.FloatBox.EVENT_OPEN = "EVENT_OPEN";
BI.FloatBox.EVENT_CANCEL = "EVENT_CANCEL";
BI.FloatBox.EVENT_CONFIRM = "EVENT_CONFIRM";
BI.Popover.EVENT_CLOSE = "EVENT_CLOSE";
BI.Popover.EVENT_OPEN = "EVENT_OPEN";
BI.Popover.EVENT_CANCEL = "EVENT_CANCEL";
BI.Popover.EVENT_CONFIRM = "EVENT_CONFIRM";

34
src/core/controller/controller.floatbox.js

@ -1,25 +1,25 @@
/**
* guy
* FloatBox弹出层控制器, z-index在100w层级
* @class BI.FloatBoxController
* popover弹出层控制器, z-index在100w层级
* @class BI.popoverController
* @extends BI.Controller
*/
BI.FloatBoxController = BI.inherit(BI.Controller, {
BI.PopoverController = BI.inherit(BI.Controller, {
_defaultConfig: function () {
return BI.extend(BI.FloatBoxController.superclass._defaultConfig.apply(this, arguments), {
return BI.extend(BI.PopoverController.superclass._defaultConfig.apply(this, arguments), {
modal: true, // 模态窗口
render: "body"
});
},
_init: function () {
BI.FloatBoxController.superclass._init.apply(this, arguments);
BI.PopoverController.superclass._init.apply(this, arguments);
this.modal = this.options.modal;
this.floatManager = {};
this.floatLayer = {};
this.floatContainer = {};
this.floatOpened = {};
this.zindex = BI.zIndex_floatbox;
this.zindex = BI.zIndex_popover;
this.zindexMap = {};
},
@ -31,14 +31,14 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
if (this._check(name)) {
return this;
}
var floatbox = BI.createWidget({
type: "bi.float_box"
var popover = BI.createWidget({
type: "bi.popover"
}, options, context);
this.add(name, floatbox, options, context);
this.add(name, popover, options, context);
return this;
},
add: function (name, floatbox, options, context) {
add: function (name, popover, options, context) {
var self = this;
options || (options = {});
if (this._check(name)) {
@ -50,7 +50,7 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
items: [{
el: (this.floatLayer[name] = BI.createWidget({
type: "bi.absolute",
items: [floatbox]
items: [popover]
}, context)),
left: 0,
right: 0,
@ -58,9 +58,9 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
bottom: 0
}]
});
this.floatManager[name] = floatbox;
this.floatManager[name] = popover;
(function (key) {
floatbox.on(BI.FloatBox.EVENT_CLOSE, function () {
popover.on(BI.Popover.EVENT_CLOSE, function () {
self.close(key);
});
})(name);
@ -91,10 +91,10 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
this.modal && container.element.__buildZIndexMask__(this.zindex++);
this.get(name).setZindex(this.zindex++);
this.floatContainer[name].visible();
var floatbox = this.get(name);
floatbox.show && floatbox.show();
var popover = this.get(name);
popover.show && popover.show();
var W = $(this.options.render).width(), H = $(this.options.render).height();
var w = floatbox.element.width(), h = floatbox.element.height();
var w = popover.element.width(), h = popover.element.height();
var left = (W - w) / 2, top = (H - h) / 2;
if (left < 0) {
left = 0;
@ -102,7 +102,7 @@ BI.FloatBoxController = BI.inherit(BI.Controller, {
if (top < 0) {
top = 0;
}
floatbox.element.css({
popover.element.css({
left: left + "px",
top: top + "px"
});

2
src/core/var.js

@ -7,7 +7,7 @@ _.extend(BI, {
MIN: -0xfffffffffffffff,
EVENT_RESPONSE_TIME: 200,
zIndex_layer: 1e5,
zIndex_floatbox: 1e6,
zIndex_popover: 1e6,
zIndex_popup: 1e7,
zIndex_masker: 1e8,
zIndex_tip: 1e9,

2
src/less/var.less

@ -3,7 +3,7 @@
@image2xUrl: 'images/2x/'; //2x图片的基本地址
@zIndex-layer: 100000;
@zIndex-floatbox: 1000000;
@zIndex-popover: 1000000;
@zIndex-popup: 10000000;
@zIndex-masker: 100000000;
@zIndex-tip: 1000000000;

2
utils/utils.js

@ -9738,7 +9738,7 @@ _.extend(BI, {
MIN: -0xfffffffffffffff,
EVENT_RESPONSE_TIME: 200,
zIndex_layer: 1e5,
zIndex_floatbox: 1e6,
zIndex_popover: 1e6,
zIndex_popup: 1e7,
zIndex_masker: 1e8,
zIndex_tip: 1e9,

Loading…
Cancel
Save