|
|
|
@ -22,12 +22,8 @@ BI.PopoverController = BI.inherit(BI.Controller, {
|
|
|
|
|
this.zindexMap = {}; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_check: function (name) { |
|
|
|
|
return BI.isNotNull(this.floatManager[name]); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
create: function (name, options, context) { |
|
|
|
|
if (this._check(name)) { |
|
|
|
|
if (this.has(name)) { |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
var popover = BI.createWidget(options || {}, { |
|
|
|
@ -37,48 +33,8 @@ BI.PopoverController = BI.inherit(BI.Controller, {
|
|
|
|
|
return this; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
add: function (name, popover, options, context) { |
|
|
|
|
var self = this; |
|
|
|
|
options || (options = {}); |
|
|
|
|
if (this._check(name)) { |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
this.floatContainer[name] = BI.createWidget({ |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
cls: "bi-popup-view", |
|
|
|
|
items: [{ |
|
|
|
|
el: (this.floatLayer[name] = BI.createWidget({ |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
items: [popover] |
|
|
|
|
}, context)), |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0 |
|
|
|
|
}] |
|
|
|
|
}); |
|
|
|
|
this.floatManager[name] = popover; |
|
|
|
|
(function (key) { |
|
|
|
|
popover.on(BI.Popover.EVENT_CLOSE, function () { |
|
|
|
|
self.close(key); |
|
|
|
|
}); |
|
|
|
|
})(name); |
|
|
|
|
BI.createWidget({ |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
element: options.container || this.options.render, |
|
|
|
|
items: [{ |
|
|
|
|
el: this.floatContainer[name], |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0 |
|
|
|
|
}] |
|
|
|
|
}); |
|
|
|
|
return this; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
open: function (name) { |
|
|
|
|
if (!this._check(name)) { |
|
|
|
|
if (!this.has(name)) { |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
if (!this.floatOpened[name]) { |
|
|
|
@ -110,7 +66,7 @@ BI.PopoverController = BI.inherit(BI.Controller, {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
close: function (name) { |
|
|
|
|
if (!this._check(name)) { |
|
|
|
|
if (!this.has(name)) { |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
if (this.floatOpened[name]) { |
|
|
|
@ -121,10 +77,66 @@ BI.PopoverController = BI.inherit(BI.Controller, {
|
|
|
|
|
return this; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
show: function (name) { |
|
|
|
|
return this.open(name); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
hide: function (name) { |
|
|
|
|
return this.close(name); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
isVisible: function (name) { |
|
|
|
|
return this.has(name) && this.floatOpened[name] === true; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
add: function (name, popover, options, context) { |
|
|
|
|
var self = this; |
|
|
|
|
options || (options = {}); |
|
|
|
|
if (this.has(name)) { |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
this.floatContainer[name] = BI.createWidget({ |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
cls: "bi-popup-view", |
|
|
|
|
items: [{ |
|
|
|
|
el: (this.floatLayer[name] = BI.createWidget({ |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
items: [popover] |
|
|
|
|
}, context)), |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0 |
|
|
|
|
}] |
|
|
|
|
}); |
|
|
|
|
this.floatManager[name] = popover; |
|
|
|
|
(function (key) { |
|
|
|
|
popover.on(BI.Popover.EVENT_CLOSE, function () { |
|
|
|
|
self.close(key); |
|
|
|
|
}); |
|
|
|
|
})(name); |
|
|
|
|
BI.createWidget({ |
|
|
|
|
type: "bi.absolute", |
|
|
|
|
element: options.container || this.options.render, |
|
|
|
|
items: [{ |
|
|
|
|
el: this.floatContainer[name], |
|
|
|
|
left: 0, |
|
|
|
|
right: 0, |
|
|
|
|
top: 0, |
|
|
|
|
bottom: 0 |
|
|
|
|
}] |
|
|
|
|
}); |
|
|
|
|
return this; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
get: function (name) { |
|
|
|
|
return this.floatManager[name]; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
has: function (name) { |
|
|
|
|
return BI.isNotNull(this.floatManager[name]); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
remove: function (name) { |
|
|
|
|
if (!this._check(name)) { |
|
|
|
|
return this; |
|
|
|
|