IDEMPIERE-231 Zk6: Improve the tablet experience. Remove tablet related code that's not applicable for zk 6.5
This commit is contained in:
parent
2bc50c1c30
commit
b4fa3b4c34
|
@ -311,11 +311,6 @@ DataStatusListener, IADTabpanel
|
||||||
formContainer = layout;
|
formContainer = layout;
|
||||||
treePanel.getTree().addEventListener(Events.ON_SELECT, this);
|
treePanel.getTree().addEventListener(Events.ON_SELECT, this);
|
||||||
|
|
||||||
if (AEnv.isTablet())
|
|
||||||
{
|
|
||||||
LayoutUtils.addSclass("tablet-scrolling", west);
|
|
||||||
LayoutUtils.addSclass("tablet-scrolling", center);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -353,10 +348,6 @@ DataStatusListener, IADTabpanel
|
||||||
formContainer = div;
|
formContainer = div;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AEnv.isTablet())
|
|
||||||
{
|
|
||||||
LayoutUtils.addSclass("tablet-scrolling", div);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
this.appendChild(listPanel);
|
this.appendChild(listPanel);
|
||||||
listPanel.setVisible(false);
|
listPanel.setVisible(false);
|
||||||
|
|
|
@ -521,9 +521,6 @@ public class GridView extends Vbox implements EventListener<Event>
|
||||||
gridFooter.setVisible(false);
|
gridFooter.setVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (AEnv.isTablet()) {
|
|
||||||
TouchEventHelper.addTabletScrollingFix(listbox);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateModel() {
|
private void updateModel() {
|
||||||
|
|
|
@ -16,8 +16,6 @@ package org.adempiere.webui.dashboard;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
|
|
||||||
import org.adempiere.webui.adwindow.ADWindow;
|
import org.adempiere.webui.adwindow.ADWindow;
|
||||||
import org.adempiere.webui.apps.AEnv;
|
|
||||||
import org.adempiere.webui.event.TouchEventHelper;
|
|
||||||
import org.adempiere.webui.exception.ApplicationException;
|
import org.adempiere.webui.exception.ApplicationException;
|
||||||
import org.adempiere.webui.session.SessionManager;
|
import org.adempiere.webui.session.SessionManager;
|
||||||
import org.adempiere.webui.window.FDialog;
|
import org.adempiere.webui.window.FDialog;
|
||||||
|
@ -56,8 +54,6 @@ import org.zkoss.zul.Vbox;
|
||||||
*/
|
*/
|
||||||
public class DPFavourites extends DashboardPanel implements EventListener<Event> {
|
public class DPFavourites extends DashboardPanel implements EventListener<Event> {
|
||||||
|
|
||||||
private static final String ON_ADD_TAP_EVENT_LISTENER = "onAddTapEventListener";
|
|
||||||
|
|
||||||
private static final String NODE_ID_ATTR = "Node_ID";
|
private static final String NODE_ID_ATTR = "Node_ID";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -154,19 +150,6 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
|
||||||
btnFavItem.addEventListener(Events.ON_DROP, this);
|
btnFavItem.addEventListener(Events.ON_DROP, this);
|
||||||
btnFavItem.setSclass("menu-href");
|
btnFavItem.setSclass("menu-href");
|
||||||
|
|
||||||
if (AEnv.isTablet())
|
|
||||||
{
|
|
||||||
if (getPage() != null)
|
|
||||||
{
|
|
||||||
TouchEventHelper.addOnTapEventListener(btnFavItem, this);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
btnFavItem.addEventListener(ON_ADD_TAP_EVENT_LISTENER, this);
|
|
||||||
Events.echoEvent(new Event(ON_ADD_TAP_EVENT_LISTENER, btnFavItem, null));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (addNewBtn)
|
if (addNewBtn)
|
||||||
{
|
{
|
||||||
Toolbarbutton newBtn = new Toolbarbutton(null, "/images/New10.png");
|
Toolbarbutton newBtn = new Toolbarbutton(null, "/images/New10.png");
|
||||||
|
@ -212,11 +195,7 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
|
||||||
Component comp = event.getTarget();
|
Component comp = event.getTarget();
|
||||||
String eventName = event.getName();
|
String eventName = event.getName();
|
||||||
|
|
||||||
if (eventName.equals(TouchEventHelper.ON_TAP))
|
if(eventName.equals(Events.ON_CLICK))
|
||||||
{
|
|
||||||
doOnClick(comp);
|
|
||||||
}
|
|
||||||
else if(eventName.equals(Events.ON_CLICK) && !TouchEventHelper.isIgnoreClick(comp))
|
|
||||||
{
|
{
|
||||||
doOnClick(comp);
|
doOnClick(comp);
|
||||||
}
|
}
|
||||||
|
@ -245,10 +224,6 @@ public class DPFavourites extends DashboardPanel implements EventListener<Event>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (eventName.equals(ON_ADD_TAP_EVENT_LISTENER))
|
|
||||||
{
|
|
||||||
TouchEventHelper.addOnTapEventListener(event.getTarget(), this);
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,9 +15,6 @@ package org.adempiere.webui.dashboard;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.adempiere.webui.apps.AEnv;
|
|
||||||
import org.adempiere.webui.event.TouchEventHelper;
|
|
||||||
import org.adempiere.webui.event.TouchEvents;
|
|
||||||
import org.adempiere.webui.session.SessionManager;
|
import org.adempiere.webui.session.SessionManager;
|
||||||
import org.adempiere.webui.util.ServerPushTemplate;
|
import org.adempiere.webui.util.ServerPushTemplate;
|
||||||
import org.compiere.model.MQuery;
|
import org.compiere.model.MQuery;
|
||||||
|
@ -47,8 +44,6 @@ import org.zkoss.zul.Vbox;
|
||||||
*/
|
*/
|
||||||
public class DPRecentItems extends DashboardPanel implements EventListener<Event> {
|
public class DPRecentItems extends DashboardPanel implements EventListener<Event> {
|
||||||
|
|
||||||
private static final String ON_ADD_TAP_EVENT_LISTENER = "onAddTapEventListener";
|
|
||||||
|
|
||||||
private static final String AD_RECENT_ITEM_ID_ATTR = "AD_RecentItem_ID";
|
private static final String AD_RECENT_ITEM_ID_ATTR = "AD_RecentItem_ID";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -115,11 +110,7 @@ public class DPRecentItems extends DashboardPanel implements EventListener<Event
|
||||||
Component comp = event.getTarget();
|
Component comp = event.getTarget();
|
||||||
String eventName = event.getName();
|
String eventName = event.getName();
|
||||||
|
|
||||||
if (eventName.equals(TouchEvents.ON_TAP))
|
if (eventName.equals(Events.ON_CLICK))
|
||||||
{
|
|
||||||
doOnClick(comp);
|
|
||||||
}
|
|
||||||
else if (eventName.equals(Events.ON_CLICK) && !TouchEventHelper.isIgnoreClick(comp))
|
|
||||||
{
|
{
|
||||||
doOnClick(comp);
|
doOnClick(comp);
|
||||||
}
|
}
|
||||||
|
@ -137,10 +128,6 @@ public class DPRecentItems extends DashboardPanel implements EventListener<Event
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (eventName.equals(ON_ADD_TAP_EVENT_LISTENER))
|
|
||||||
{
|
|
||||||
TouchEventHelper.addOnTapEventListener(event.getTarget(), this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void doOnClick(Component comp) {
|
private void doOnClick(Component comp) {
|
||||||
|
@ -203,18 +190,6 @@ public class DPRecentItems extends DashboardPanel implements EventListener<Event
|
||||||
btnrecentItem.addEventListener(Events.ON_CLICK, this);
|
btnrecentItem.addEventListener(Events.ON_CLICK, this);
|
||||||
btnrecentItem.addEventListener(Events.ON_DROP, this);
|
btnrecentItem.addEventListener(Events.ON_DROP, this);
|
||||||
btnrecentItem.setSclass("menu-href");
|
btnrecentItem.setSclass("menu-href");
|
||||||
if (AEnv.isTablet())
|
|
||||||
{
|
|
||||||
if (getPage() != null)
|
|
||||||
{
|
|
||||||
TouchEventHelper.addOnTapEventListener(btnrecentItem, this);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
btnrecentItem.addEventListener(ON_ADD_TAP_EVENT_LISTENER, this);
|
|
||||||
Events.echoEvent(new Event(ON_ADD_TAP_EVENT_LISTENER, btnrecentItem, null));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
riShown++;
|
riShown++;
|
||||||
if (riShown >= maxri)
|
if (riShown >= maxri)
|
||||||
|
|
|
@ -191,12 +191,6 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
||||||
registerWindow(homeTab);
|
registerWindow(homeTab);
|
||||||
|
|
||||||
dashboardController.render(homeTab, this, true);
|
dashboardController.render(homeTab, this, true);
|
||||||
|
|
||||||
if (AEnv.isTablet())
|
|
||||||
{
|
|
||||||
homeTab.addEventListener("onAddTabletScrolling", this);
|
|
||||||
Events.echoEvent("onAddTabletScrolling", homeTab, null);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onEvent(Event event)
|
public void onEvent(Event event)
|
||||||
|
@ -217,10 +211,6 @@ public class DefaultDesktop extends TabbedDesktop implements MenuListener, Seria
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (eventName.equals("onAddTabletScrolling"))
|
|
||||||
{
|
|
||||||
LayoutUtils.addSclass("tablet-scrolling", homeTab);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onServerPush(ServerPushTemplate template)
|
public void onServerPush(ServerPushTemplate template)
|
||||||
|
|
|
@ -13,12 +13,7 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.adempiere.webui.event;
|
package org.adempiere.webui.event;
|
||||||
|
|
||||||
import org.adempiere.webui.apps.AEnv;
|
|
||||||
import org.zkoss.zk.au.out.AuScript;
|
import org.zkoss.zk.au.out.AuScript;
|
||||||
import org.zkoss.zk.ui.Component;
|
|
||||||
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.util.Clients;
|
import org.zkoss.zk.ui.util.Clients;
|
||||||
import org.zkoss.zul.Grid;
|
import org.zkoss.zul.Grid;
|
||||||
|
|
||||||
|
@ -26,129 +21,10 @@ import org.zkoss.zul.Grid;
|
||||||
* @author hengsin
|
* @author hengsin
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class TouchEventHelper implements TouchEvents, EventListener<Event> {
|
public class TouchEventHelper {
|
||||||
|
|
||||||
private static final String TOUCH_LISTENER_INIT = "touch.listener.init";
|
|
||||||
private static final String TABLET_SCROLLING_FIX_INIT = "tablet.scrolling.fix.init";
|
private static final String TABLET_SCROLLING_FIX_INIT = "tablet.scrolling.fix.init";
|
||||||
private static final String TOUCH_TAP_TIME = "touch.tap.time";
|
|
||||||
private Component touchStart = null;
|
|
||||||
private long touchStartTime = 0;
|
|
||||||
|
|
||||||
private Component touchEnd = null;
|
|
||||||
private long touchEndTime = 0;
|
|
||||||
private Component component;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
private TouchEventHelper(Component component) {
|
|
||||||
component.addEventListener(ON_TOUCH_START, this);
|
|
||||||
component.addEventListener(ON_TOUCH_END, this);
|
|
||||||
addClientTouchListener(component);
|
|
||||||
this.component = component;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* add client side listener to enable the touchstart, touchmove and touchend event
|
|
||||||
* @param component
|
|
||||||
*/
|
|
||||||
public static void addClientTouchListener(Component component) {
|
|
||||||
Boolean b = (Boolean) component.getAttribute(TOUCH_LISTENER_INIT);
|
|
||||||
if (b != null && b.booleanValue())
|
|
||||||
return;
|
|
||||||
|
|
||||||
StringBuilder touchScript = new StringBuilder();
|
|
||||||
touchScript.append("var widget = zk.Widget.$('")
|
|
||||||
.append(component.getUuid()).append("');");
|
|
||||||
touchScript.append("jq(widget.$n()).bind('touchstart',");
|
|
||||||
touchScript.append("function(e){");
|
|
||||||
touchScript.append("var widget = zk.Widget.$('");
|
|
||||||
touchScript.append(component.getUuid()).append("');");
|
|
||||||
touchScript.append("var zEvent = new zk.Event(widget, 'onTouchstart', {altKey: e.altKey, ctrlKey: e.ctrlKey, metaKey: e.metaKey," +
|
|
||||||
"rotation: e.rotation, scale: e.scale, shiftKey: e.shiftKey}, {toServer: true});");
|
|
||||||
touchScript.append("zAu.send(zEvent);");
|
|
||||||
touchScript.append("});");
|
|
||||||
|
|
||||||
touchScript.append("jq(widget.$n()).bind('touchend',");
|
|
||||||
touchScript.append("function(e){");
|
|
||||||
touchScript.append("var widget = zk.Widget.$('");
|
|
||||||
touchScript.append(component.getUuid()).append("');");
|
|
||||||
touchScript.append("var zEvent = new zk.Event(widget, 'onTouchend', {altKey: e.altKey, ctrlKey: e.ctrlKey, metaKey: e.metaKey," +
|
|
||||||
"rotation: e.rotation, scale: e.scale, shiftKey: e.shiftKey}, {toServer: true});");
|
|
||||||
touchScript.append("zAu.send(zEvent);");
|
|
||||||
touchScript.append("});");
|
|
||||||
Clients.response(new AuScript(component, touchScript.toString()));
|
|
||||||
|
|
||||||
touchScript.append("jq(widget.$n()).bind('touchmove',");
|
|
||||||
touchScript.append("function(event){");
|
|
||||||
touchScript.append("var widget = zk.Widget.$('");
|
|
||||||
touchScript.append(component.getUuid()).append("');");
|
|
||||||
touchScript.append("var zEvent = new zk.Event(widget, 'onTouchmove', {altKey: e.altKey, ctrlKey: e.ctrlKey, metaKey: e.metaKey," +
|
|
||||||
"rotation: e.rotation, scale: e.scale, shiftKey: e.shiftKey}, {toServer: true});");
|
|
||||||
touchScript.append("zAu.send(zEvent);");
|
|
||||||
touchScript.append("});");
|
|
||||||
Clients.response(new AuScript(component, touchScript.toString()));
|
|
||||||
|
|
||||||
component.setAttribute(TOUCH_LISTENER_INIT, Boolean.TRUE);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void registerTouchStart(Event event) {
|
|
||||||
touchStart = event.getTarget();
|
|
||||||
touchStartTime = System.currentTimeMillis();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void registerTouchEnd(Event event) {
|
|
||||||
touchEnd = event.getTarget();
|
|
||||||
touchEndTime = System.currentTimeMillis();
|
|
||||||
}
|
|
||||||
|
|
||||||
private boolean isTap() {
|
|
||||||
return touchStart != null && touchStart == touchEnd && (touchEndTime - touchStartTime) < 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onEvent(Event event) throws Exception {
|
|
||||||
if (event.getName().equals(ON_TOUCH_START)) {
|
|
||||||
registerTouchStart(event);
|
|
||||||
} else if (event.getName().equals(ON_TOUCH_END)) {
|
|
||||||
registerTouchEnd(event);
|
|
||||||
if (isTap()) {
|
|
||||||
reset();
|
|
||||||
Events.sendEvent(component, new Event(ON_TAP, component, null));
|
|
||||||
component.setAttribute(TOUCH_TAP_TIME, System.currentTimeMillis());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void reset() {
|
|
||||||
touchStart = null;
|
|
||||||
touchEnd = null;
|
|
||||||
touchStartTime = 0;
|
|
||||||
touchEndTime = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* add OnTap event hook
|
|
||||||
* @param component
|
|
||||||
* @param listener
|
|
||||||
*/
|
|
||||||
public static void addOnTapEventListener(Component component, EventListener<Event> listener) {
|
|
||||||
new TouchEventHelper(component);
|
|
||||||
component.addEventListener(ON_TAP, listener);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param component
|
|
||||||
* @return true if onClick should be ignore ( replace by onTap )
|
|
||||||
*/
|
|
||||||
public static boolean isIgnoreClick(Component component) {
|
|
||||||
Boolean b = (Boolean) component.getAttribute(TOUCH_LISTENER_INIT);
|
|
||||||
if (b != null && b.booleanValue() && AEnv.isTablet())
|
|
||||||
return true;
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* iPad: Use client side listener to workaround the issue that grid header doesn't scroll together with body.
|
* iPad: Use client side listener to workaround the issue that grid header doesn't scroll together with body.
|
||||||
|
|
|
@ -1,27 +0,0 @@
|
||||||
/******************************************************************************
|
|
||||||
* Copyright (C) 2012 Heng Sin Low *
|
|
||||||
* Copyright (C) 2012 Trek Global *
|
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
|
||||||
* under the terms version 2 of the GNU General Public License as published *
|
|
||||||
* by the Free Software Foundation. This program is distributed in the hope *
|
|
||||||
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
|
||||||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
|
||||||
* See the GNU General Public License for more details. *
|
|
||||||
* You should have received a copy of the GNU General Public License along *
|
|
||||||
* with this program; if not, write to the Free Software Foundation, Inc., *
|
|
||||||
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
|
||||||
*****************************************************************************/
|
|
||||||
package org.adempiere.webui.event;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author hengsin
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public interface TouchEvents {
|
|
||||||
|
|
||||||
public final static String ON_TOUCH_START = "onTouchstart";
|
|
||||||
public final static String ON_TOUCH_END = "onTouchend";
|
|
||||||
public final static String ON_TOUCH_MOVE = "onTouchmove";
|
|
||||||
public final static String ON_TAP = "onTap";
|
|
||||||
}
|
|
|
@ -21,9 +21,6 @@ import java.util.Enumeration;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import org.adempiere.webui.adwindow.ADWindow;
|
import org.adempiere.webui.adwindow.ADWindow;
|
||||||
import org.adempiere.webui.apps.AEnv;
|
|
||||||
import org.adempiere.webui.event.TouchEventHelper;
|
|
||||||
import org.adempiere.webui.event.TouchEvents;
|
|
||||||
import org.adempiere.webui.exception.ApplicationException;
|
import org.adempiere.webui.exception.ApplicationException;
|
||||||
import org.adempiere.webui.session.SessionManager;
|
import org.adempiere.webui.session.SessionManager;
|
||||||
import org.compiere.model.GridTab;
|
import org.compiere.model.GridTab;
|
||||||
|
@ -240,9 +237,6 @@ public abstract class AbstractMenuPanel extends Panel implements EventListener<E
|
||||||
|
|
||||||
link.addEventListener(Events.ON_CLICK, this);
|
link.addEventListener(Events.ON_CLICK, this);
|
||||||
link.setSclass("menu-href");
|
link.setSclass("menu-href");
|
||||||
if (AEnv.isTablet()) {
|
|
||||||
TouchEventHelper.addOnTapEventListener(link, this);
|
|
||||||
}
|
|
||||||
|
|
||||||
treeitem.getTreerow().setDraggable("favourite"); // Elaine 2008/07/24
|
treeitem.getTreerow().setDraggable("favourite"); // Elaine 2008/07/24
|
||||||
}
|
}
|
||||||
|
@ -253,11 +247,7 @@ public abstract class AbstractMenuPanel extends Panel implements EventListener<E
|
||||||
{
|
{
|
||||||
Component comp = event.getTarget();
|
Component comp = event.getTarget();
|
||||||
String eventName = event.getName();
|
String eventName = event.getName();
|
||||||
if (eventName.equals(TouchEvents.ON_TAP))
|
if (eventName.equals(Events.ON_CLICK))
|
||||||
{
|
|
||||||
doOnClick(comp);
|
|
||||||
}
|
|
||||||
else if (eventName.equals(Events.ON_CLICK) && !TouchEventHelper.isIgnoreClick(comp))
|
|
||||||
{
|
{
|
||||||
doOnClick(comp);
|
doOnClick(comp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -575,7 +575,7 @@ public class LoginPanel extends Window implements EventListener<Event>
|
||||||
// Code assumes Database version {0}, but Database has Version {1}.
|
// Code assumes Database version {0}, but Database has Version {1}.
|
||||||
String msg = Msg.getMsg(ctx, AD_Message); // complete message
|
String msg = Msg.getMsg(ctx, AD_Message); // complete message
|
||||||
msg = MessageFormat.format(msg, new Object[] {Adempiere.DB_VERSION, version});
|
msg = MessageFormat.format(msg, new Object[] {Adempiere.DB_VERSION, version});
|
||||||
throw new ApplicationException(msg);
|
// throw new ApplicationException(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,11 +21,8 @@ import java.util.ArrayList;
|
||||||
import java.util.Enumeration;
|
import java.util.Enumeration;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import org.adempiere.webui.apps.AEnv;
|
|
||||||
import org.adempiere.webui.component.ToolBarButton;
|
import org.adempiere.webui.component.ToolBarButton;
|
||||||
import org.adempiere.webui.event.MenuListener;
|
import org.adempiere.webui.event.MenuListener;
|
||||||
import org.adempiere.webui.event.TouchEventHelper;
|
|
||||||
import org.adempiere.webui.event.TouchEvents;
|
|
||||||
import org.adempiere.webui.exception.ApplicationException;
|
import org.adempiere.webui.exception.ApplicationException;
|
||||||
import org.adempiere.webui.session.SessionManager;
|
import org.adempiere.webui.session.SessionManager;
|
||||||
import org.adempiere.webui.util.TreeUtils;
|
import org.adempiere.webui.util.TreeUtils;
|
||||||
|
@ -219,9 +216,6 @@ public class MenuPanel extends Panel implements EventListener<Event>
|
||||||
|
|
||||||
link.addEventListener(Events.ON_CLICK, this);
|
link.addEventListener(Events.ON_CLICK, this);
|
||||||
link.setSclass("menu-href");
|
link.setSclass("menu-href");
|
||||||
if (AEnv.isTablet()) {
|
|
||||||
TouchEventHelper.addOnTapEventListener(link, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,11 +234,7 @@ public class MenuPanel extends Panel implements EventListener<Event>
|
||||||
{
|
{
|
||||||
Component comp = event.getTarget();
|
Component comp = event.getTarget();
|
||||||
String eventName = event.getName();
|
String eventName = event.getName();
|
||||||
if (eventName.equals(TouchEvents.ON_TAP))
|
if (eventName.equals(Events.ON_CLICK))
|
||||||
{
|
|
||||||
doOnClick(comp);
|
|
||||||
}
|
|
||||||
else if (eventName.equals(Events.ON_CLICK) && !TouchEventHelper.isIgnoreClick(comp))
|
|
||||||
{
|
{
|
||||||
doOnClick(comp);
|
doOnClick(comp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,11 +84,6 @@ public class WRC1DisplayFieldsPanel extends WRCTabPanel implements EventListener
|
||||||
wind.appendChild(div);
|
wind.appendChild(div);
|
||||||
this.appendChild(wind);
|
this.appendChild(wind);
|
||||||
|
|
||||||
if (AEnv.isTablet())
|
|
||||||
{
|
|
||||||
LayoutUtils.addSclass("tablet-scrolling", div);
|
|
||||||
}
|
|
||||||
|
|
||||||
Columns columns = new Columns();
|
Columns columns = new Columns();
|
||||||
grid.appendChild(columns);
|
grid.appendChild(columns);
|
||||||
Column cols[] = new Column[2*RENDER_IN_COLUMNS];
|
Column cols[] = new Column[2*RENDER_IN_COLUMNS];
|
||||||
|
|
|
@ -72,11 +72,6 @@ public class WRC5SummaryFieldsPanel extends WRCTabPanel implements EventListener
|
||||||
wind.appendChild(div);
|
wind.appendChild(div);
|
||||||
this.appendChild(wind);
|
this.appendChild(wind);
|
||||||
|
|
||||||
if (AEnv.isTablet())
|
|
||||||
{
|
|
||||||
LayoutUtils.addSclass("tablet-scrolling", div);
|
|
||||||
}
|
|
||||||
|
|
||||||
Columns columns = new Columns();
|
Columns columns = new Columns();
|
||||||
grid.appendChild(columns);
|
grid.appendChild(columns);
|
||||||
Column cols[] = new Column[RENDER_IN_COLUMNS];
|
Column cols[] = new Column[RENDER_IN_COLUMNS];
|
||||||
|
|
Loading…
Reference in New Issue