IDEMPIERE-689 Zk Desktop: The auto collapsed of the left panel should be faster and more reliable.
This commit is contained in:
parent
494fdca8ce
commit
1c924e4833
|
@ -30,6 +30,7 @@ import org.adempiere.webui.apps.AEnv;
|
||||||
import org.adempiere.webui.apps.BusyDialog;
|
import org.adempiere.webui.apps.BusyDialog;
|
||||||
import org.adempiere.webui.apps.ProcessDialog;
|
import org.adempiere.webui.apps.ProcessDialog;
|
||||||
import org.adempiere.webui.apps.WReport;
|
import org.adempiere.webui.apps.WReport;
|
||||||
|
import org.adempiere.webui.component.Tab;
|
||||||
import org.adempiere.webui.component.Tabpanel;
|
import org.adempiere.webui.component.Tabpanel;
|
||||||
import org.adempiere.webui.component.ToolBarButton;
|
import org.adempiere.webui.component.ToolBarButton;
|
||||||
import org.adempiere.webui.event.DrillEvent;
|
import org.adempiere.webui.event.DrillEvent;
|
||||||
|
@ -438,14 +439,22 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//use _docClick undocumented api. need verification after major zk release update
|
||||||
|
private final static String autoHideMenuScript = "try{var w=zk.Widget.$('#{0}');var t=zk.Widget.$('#{1}');" +
|
||||||
|
"var e=new Object;e.target=t;w._docClick(e);}catch(error){}";
|
||||||
|
|
||||||
private void autoHideMenu() {
|
private void autoHideMenu() {
|
||||||
if (layout.getWest().isCollapsible() && !layout.getWest().isOpen())
|
if (layout.getWest().isCollapsible() && !layout.getWest().isOpen())
|
||||||
{
|
{
|
||||||
String id = layout.getWest().getUuid();
|
String id = layout.getWest().getUuid();
|
||||||
//$n('colled') is not documented api so this might break in release after 6.0.0
|
Tab tab = windowContainer.getSelectedTab();
|
||||||
String script = "jq(zk.Widget.$('"+id+"').$n('colled')).click();";
|
if (tab != null) {
|
||||||
AuScript aus = new AuScript(layout.getWest(), script);
|
String tabId = tab.getUuid();
|
||||||
Clients.response("autoHideWest", aus);
|
String script = autoHideMenuScript.replace("{0}", id);
|
||||||
|
script = script.replace("{1}", tabId);
|
||||||
|
AuScript aus = new AuScript(layout.getWest(), script);
|
||||||
|
Clients.response("autoHideWest", aus);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -169,6 +169,7 @@ public abstract class TabbedDesktop extends AbstractDesktop {
|
||||||
runnable.run();
|
runnable.run();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
preOpenNewTab();
|
||||||
Events.echoEvent(new Event("onOpenWindow", tabPanel));
|
Events.echoEvent(new Event("onOpenWindow", tabPanel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -259,6 +260,7 @@ public abstract class TabbedDesktop extends AbstractDesktop {
|
||||||
runnable.run();
|
runnable.run();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
preOpenNewTab();
|
||||||
Events.echoEvent(new Event("onOpenWindow", tabPanel));
|
Events.echoEvent(new Event("onOpenWindow", tabPanel));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -383,8 +385,7 @@ public abstract class TabbedDesktop extends AbstractDesktop {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
preOpenNewTab();
|
|
||||||
if (adWindow.createPart(tabPanel) != null ) {
|
if (adWindow.createPart(tabPanel) != null ) {
|
||||||
tab.setImage(null);
|
tab.setImage(null);
|
||||||
tab.setClosable(true);
|
tab.setClosable(true);
|
||||||
|
|
Loading…
Reference in New Issue