2012-08-22 16:45:31 +07:00
|
|
|
function _idempiere_popup_window(refid, windowid, position) {
|
|
|
|
var ref = zk.Widget.$(refid);
|
|
|
|
var window = zk(windowid);
|
|
|
|
window.position(ref.$n(), position);
|
|
|
|
}
|
2013-03-27 15:21:44 +07:00
|
|
|
|
|
|
|
zk.override(zk.Widget.prototype, "canActivate",
|
|
|
|
function () {
|
|
|
|
var b = this.$canActivate.apply(this, arguments);
|
|
|
|
if (b) {
|
|
|
|
if (zk.currentModal) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
var wgt = this;
|
|
|
|
while (wgt) {
|
2013-06-24 16:45:25 +07:00
|
|
|
if (wgt.busy) {
|
2013-03-27 15:21:44 +07:00
|
|
|
if (wgt.busy.className == 'zul.wnd.Window') {
|
|
|
|
if (zUtl.isAncestor(wgt.busy, this)) {
|
|
|
|
return true;
|
|
|
|
} else {
|
2013-06-24 16:45:25 +07:00
|
|
|
jq.focusOut();
|
2013-03-27 15:21:44 +07:00
|
|
|
wgt.busy.focus(0);
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
jq.focusOut();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
if (wgt.className == 'zul.wnd.Window') {
|
|
|
|
if (wgt.getMode() == 'overlapped') {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wgt = wgt.parent;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|