IDEMPIERE-5414 - Improve Dashboard Help Icon Behaviour (#1502)
* IDEMPIERE-5414 - Improve Dashboard Help Icon Behaviour * IDEMPIERE-5414 - replace Toolbar Button with <a><a/>
This commit is contained in:
parent
c1a1045d87
commit
ad29252c5e
|
@ -57,6 +57,6 @@ Copyright (C) 2007 Ashley G Ramdass (ADempiere WebUI).
|
|||
|
||||
<!-- this js module doesn't actually exists and it is here for default theme version -->
|
||||
<!-- since loading of js module is on demand, it doesn't cause any error as long as you don't try to load it -->
|
||||
<javascript-module name="idempiere.theme.default" version="202209260900" />
|
||||
<javascript-module name="idempiere.theme.default" version="202210031130" />
|
||||
|
||||
</language>
|
||||
|
|
|
@ -90,6 +90,7 @@ import org.zkoss.zk.ui.event.Event;
|
|||
import org.zkoss.zk.ui.event.EventListener;
|
||||
import org.zkoss.zk.ui.event.Events;
|
||||
import org.zkoss.zk.ui.event.MaximizeEvent;
|
||||
import org.zkoss.zul.A;
|
||||
import org.zkoss.zul.Anchorchildren;
|
||||
import org.zkoss.zul.Anchorlayout;
|
||||
import org.zkoss.zul.Caption;
|
||||
|
@ -358,23 +359,32 @@ public class DashboardController implements EventListener<Event> {
|
|||
}
|
||||
|
||||
private void renderHelpButton(Caption caption, String text) {
|
||||
ToolBarButton help = new ToolBarButton();
|
||||
caption.appendChild(help);
|
||||
A help = new A();
|
||||
help.setSclass("dashboard-content-help-icon");
|
||||
help.setVisible(false);
|
||||
if (ThemeManager.isUseFontIconForImage())
|
||||
help.setIconSclass("z-icon-Help");
|
||||
else
|
||||
help.setImage(ThemeManager.getThemeResource(IMAGES_CONTEXT_HELP_PNG));
|
||||
caption.appendChild(help);
|
||||
Popup popup = new Popup();
|
||||
popup.setSclass("dashboard-content-help");
|
||||
popup.setPopup(popup);
|
||||
Text t = new Text(text);
|
||||
popup.setSclass("dashboard-content-help");
|
||||
popup.appendChild(t);
|
||||
help.setTooltip(popup);
|
||||
help.addEventListener(Events.ON_CLICK, (Event event) -> {
|
||||
help.addEventListener(Events.ON_MOUSE_OVER, (Event event) -> {
|
||||
popup.setPage(help.getPage());
|
||||
popup.open(help, "after_start");
|
||||
LayoutUtils.autoDetachOnClose(popup);
|
||||
});
|
||||
caption.addEventListener(Events.ON_MOUSE_OVER, (Event event) -> {
|
||||
help.setVisible(true);
|
||||
});
|
||||
caption.addEventListener(Events.ON_MOUSE_OUT, (Event event) -> {
|
||||
popup.detach();
|
||||
help.setVisible(false);
|
||||
});
|
||||
}
|
||||
|
||||
private void renderGadgetPanel(MDashboardContent dc, Panel panel) throws Exception {
|
||||
|
|
|
@ -66,11 +66,6 @@
|
|||
cursor: move;
|
||||
}
|
||||
|
||||
.z-caption-content .z-toolbarbutton {
|
||||
vertical-align: middle;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
.dashboard-layout {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
@ -341,3 +336,8 @@
|
|||
.desktop-home-tabpanel .z-hlayout-inner {
|
||||
padding: 5px !important;
|
||||
}
|
||||
|
||||
.dashboard-content-help-icon {
|
||||
padding: 5px;
|
||||
cursor: default;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue