IDEMPIERE-801 Tab body mask doesn't block focus.
This commit is contained in:
parent
7f1da9d48f
commit
b253e2cdf6
|
@ -219,10 +219,10 @@ public class ValuePreference extends Window implements EventListener<Event>
|
|||
|
||||
this.setClosable(true);
|
||||
adwindowContent = findADWindowContent(ref);
|
||||
if (adwindowContent != null) {
|
||||
adwindowContent.showBusyMask();
|
||||
if (adwindowContent != null) {
|
||||
ZkCssHelper.appendStyle(this, "position: absolute;");
|
||||
adwindowContent.getComponent().getParent().appendChild(this);
|
||||
adwindowContent.showBusyMask(this);
|
||||
LayoutUtils.openOverlappedWindow(ref, this, "after_start");
|
||||
} else {
|
||||
AEnv.showCenterScreen(this);
|
||||
|
|
|
@ -104,6 +104,7 @@ import org.compiere.util.Env;
|
|||
import org.compiere.util.Msg;
|
||||
import org.compiere.util.Util;
|
||||
import org.compiere.util.WebDoc;
|
||||
import org.zkoss.zk.au.out.AuScript;
|
||||
import org.zkoss.zk.ui.AbstractComponent;
|
||||
import org.zkoss.zk.ui.Component;
|
||||
import org.zkoss.zk.ui.Executions;
|
||||
|
@ -908,8 +909,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
hideBusyMask();
|
||||
}
|
||||
});
|
||||
showBusyMask();
|
||||
getComponent().getParent().appendChild(win);
|
||||
showBusyMask(win);
|
||||
LayoutUtils.openOverlappedWindow(getComponent(), win, "middle_center");
|
||||
}
|
||||
|
||||
|
@ -951,8 +952,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
focusToActivePanel();
|
||||
}
|
||||
});
|
||||
showBusyMask();
|
||||
getComponent().getParent().appendChild(chat);
|
||||
getComponent().getParent().appendChild(chat);
|
||||
showBusyMask(chat);
|
||||
LayoutUtils.openOverlappedWindow(getComponent(), chat, "middle_center");
|
||||
chat.showWindow();
|
||||
}
|
||||
|
@ -1726,8 +1727,8 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
});
|
||||
}
|
||||
|
||||
showBusyMask();
|
||||
getComponent().getParent().appendChild(findWindow);
|
||||
getComponent().getParent().appendChild(findWindow);
|
||||
showBusyMask(findWindow);
|
||||
LayoutUtils.openEmbeddedWindow(toolbar, findWindow, "after_start");
|
||||
}
|
||||
|
||||
|
@ -2190,9 +2191,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
hideBusyMask();
|
||||
focusToActivePanel();
|
||||
}
|
||||
});
|
||||
showBusyMask();
|
||||
});
|
||||
getComponent().getParent().appendChild(messagePanel);
|
||||
showBusyMask(messagePanel);
|
||||
LayoutUtils.openOverlappedWindow(getComponent(), messagePanel, "middle_center");
|
||||
}
|
||||
//
|
||||
|
@ -2223,9 +2224,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
ProcessModalDialog dialog = new ProcessModalDialog(AbstractADWindowContent.this, getWindowNo(), AD_Process_ID,table_ID, record_ID, true);
|
||||
if (dialog.isValid()) {
|
||||
dialog.setWidth("500px");
|
||||
dialog.setBorder("normal");
|
||||
showBusyMask();
|
||||
dialog.setBorder("normal");
|
||||
getComponent().getParent().appendChild(dialog);
|
||||
showBusyMask(dialog);
|
||||
LayoutUtils.openOverlappedWindow(getComponent(), dialog, "middle_center");
|
||||
dialog.focus();
|
||||
}
|
||||
|
@ -2474,9 +2475,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
boolean isProcessMandatory = true;
|
||||
executeButtonProcess(wButton, startWOasking, table_ID, recordIdParam, isProcessMandatory);
|
||||
}
|
||||
});
|
||||
showBusyMask();
|
||||
});
|
||||
getComponent().getParent().appendChild(win);
|
||||
showBusyMask(win);
|
||||
LayoutUtils.openOverlappedWindow(getComponent(), win, "middle_center");
|
||||
win.focus();
|
||||
return;
|
||||
|
@ -2506,9 +2507,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
window.setZindex(1000);
|
||||
window.setMaximizable(true);
|
||||
window.setSizable(true);
|
||||
ZkCssHelper.appendStyle(window, "position: absolute; ");
|
||||
showBusyMask();
|
||||
ZkCssHelper.appendStyle(window, "position: absolute; ");
|
||||
getComponent().getParent().appendChild(window);
|
||||
showBusyMask(window);
|
||||
cf.showWindow();
|
||||
LayoutUtils.openOverlappedWindow(getComponent(), window, "middle_center");
|
||||
window.focus();
|
||||
|
@ -2601,11 +2602,22 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
public void hideBusyMask() {
|
||||
if (mask != null && mask.getParent() != null) {
|
||||
mask.detach();
|
||||
StringBuilder script = new StringBuilder("var w=zk.Widget.$('#");
|
||||
script.append(getComponent().getParent().getUuid()).append("');w.busy=false;");
|
||||
Clients.response(new AuScript(script.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
public void showBusyMask() {
|
||||
public void showBusyMask(Window window) {
|
||||
getComponent().getParent().appendChild(getMask());
|
||||
StringBuilder script = new StringBuilder("var w=zk.Widget.$('#");
|
||||
script.append(getComponent().getParent().getUuid()).append("');");
|
||||
if (window != null) {
|
||||
script.append("var d=zk.Widget.$('#").append(window.getUuid()).append("');w.busy=d;");
|
||||
} else {
|
||||
script.append("w.busy=true;");
|
||||
}
|
||||
Clients.response(new AuScript(script.toString()));
|
||||
}
|
||||
|
||||
private void executeButtonProcess(final IProcessButton wButton,
|
||||
|
@ -2677,7 +2689,7 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
onRefresh(true, false);
|
||||
}
|
||||
});
|
||||
showBusyMask();
|
||||
showBusyMask(form);
|
||||
LayoutUtils.openOverlappedWindow(getComponent(), form, "middle_center");
|
||||
form.focus();
|
||||
}
|
||||
|
@ -2692,9 +2704,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
if (dialog.isValid())
|
||||
{
|
||||
dialog.setWidth("500px");
|
||||
dialog.setBorder("normal");
|
||||
showBusyMask();
|
||||
dialog.setBorder("normal");
|
||||
getComponent().getParent().appendChild(dialog);
|
||||
showBusyMask(dialog);
|
||||
LayoutUtils.openOverlappedWindow(getComponent(), dialog, "middle_center");
|
||||
dialog.focus();
|
||||
}
|
||||
|
@ -2842,9 +2854,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements
|
|||
public void onEvent(Event event) throws Exception {
|
||||
hideBusyMask();
|
||||
}
|
||||
});
|
||||
showBusyMask();
|
||||
getComponent().getParent().appendChild(dialog);
|
||||
});
|
||||
getComponent().getParent().appendChild(dialog);
|
||||
showBusyMask(dialog);
|
||||
LayoutUtils.openOverlappedWindow(this.getComponent(),dialog,"middle_center");
|
||||
}
|
||||
|
||||
|
|
|
@ -162,9 +162,9 @@ public class WBinaryEditor extends WEditor
|
|||
});
|
||||
adwindow = ADWindow.findADWindow(getComponent());
|
||||
if (adwindow != null) {
|
||||
ADWindowContent content = adwindow.getADWindowContent();
|
||||
content.showBusyMask();
|
||||
ADWindowContent content = adwindow.getADWindowContent();
|
||||
content.getComponent().getParent().appendChild(dialog);
|
||||
content.showBusyMask(dialog);
|
||||
LayoutUtils.openOverlappedWindow(content.getComponent().getParent(), dialog, "middle_center");
|
||||
} else {
|
||||
AEnv.showWindow(dialog);
|
||||
|
|
|
@ -248,7 +248,7 @@ public class WStringEditor extends WEditor implements ContextMenuListener
|
|||
if (adwindowContent != null)
|
||||
{
|
||||
adwindowContent.getComponent().getParent().appendChild(dialog);
|
||||
adwindowContent.showBusyMask();
|
||||
adwindowContent.showBusyMask(dialog);
|
||||
LayoutUtils.openOverlappedWindow(adwindowContent.getComponent().getParent(), dialog, "middle_center");
|
||||
}
|
||||
else
|
||||
|
|
|
@ -133,9 +133,9 @@ public class ExportAction implements EventListener<Event>
|
|||
vb.appendChild(confirmPanel);
|
||||
confirmPanel.addActionListener(this);
|
||||
}
|
||||
|
||||
panel.showBusyMask();
|
||||
|
||||
panel.getComponent().getParent().appendChild(winExportFile);
|
||||
panel.showBusyMask(winExportFile);
|
||||
LayoutUtils.openOverlappedWindow(panel.getComponent(), winExportFile, "middle_center");
|
||||
winExportFile.addEventListener(DialogEvents.ON_WINDOW_CLOSE, this);
|
||||
}
|
||||
|
|
|
@ -195,9 +195,9 @@ public class FileImportAction implements EventListener<Event>
|
|||
vb.appendChild(confirmPanel);
|
||||
confirmPanel.addActionListener(this);
|
||||
}
|
||||
|
||||
panel.showBusyMask();
|
||||
|
||||
panel.getComponent().getParent().appendChild(winImportFile);
|
||||
panel.showBusyMask(winImportFile);
|
||||
LayoutUtils.openOverlappedWindow(panel.getComponent(), winImportFile, "middle_center");
|
||||
winImportFile.addEventListener(DialogEvents.ON_WINDOW_CLOSE, this);
|
||||
}
|
||||
|
|
|
@ -3,3 +3,38 @@ function _idempiere_popup_window(refid, windowid, position) {
|
|||
var window = zk(windowid);
|
||||
window.position(ref.$n(), position);
|
||||
}
|
||||
|
||||
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) {
|
||||
if (wgt.busy) {
|
||||
if (wgt.busy.className == 'zul.wnd.Window') {
|
||||
if (zUtl.isAncestor(wgt.busy, this)) {
|
||||
return true;
|
||||
} else {
|
||||
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;
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue