0

Remove detection of Mobile/Tablet

asked 2015-02-27 22:53:00 +0800

bakkar gravatar image bakkar
1

First of all I am new on ZK and I am working on a web application after someone else.

I would like to remove the detection of Mobile/Tablet because when the site is accessed from a Tablet device a new css is added (tablet.css.dsp) and elements are changed like from "z-button-os" to "z-button" or from "z-window-embedded-noborder" to "z-window-embedded".

By those changes the layout is displayed wrong.

Can anyone help please?

delete flag offensive retag edit

6 Answers

Sort by » oldest newest most voted
0

answered 2015-02-28 09:33:04 +0800

Darksu gravatar image Darksu
1991 1 4

Hello bakkar,

Please refer to the following url and specifically under the section mobile browser detection, where you can find how to configure, or for your case remove the configuration for a mobile/table.

http://books.zkoss.org/wiki/SmallTalks/2012/November/HowtoApplyResponsive_Design

Best Regards,

Darksu

link publish delete flag offensive edit
0

answered 2015-02-28 10:07:22 +0800

bakkar gravatar image bakkar
1

updated 2015-02-28 10:10:21 +0800

Thank you for your reply.

The page tells you that it detects the device is a tablet and make changes for you but it didn't tell me how to remove the detection.

From page "If ZK detects the client device (by user-agent) is a tablet, it sets viewport size to device's width and does not allow scaling its screen by meta tags."

Any Ideas?

link publish delete flag offensive edit
0

answered 2015-02-28 10:45:16 +0800

Darksu gravatar image Darksu
1991 1 4

Hello bakkar,

I was referring to the following code:

// Detect if client is mobile device (such as Android or iOS devices)
public boolean isMobile(){
    return Executions.getCurrent().getBrowser("mobile") !=null;
}

If you wish, please also upload you code so we can check it out.

Best Regards,

Darksu

link publish delete flag offensive edit
0

answered 2015-02-28 14:59:49 +0800

moreno gravatar image moreno
0 1

updated 2015-02-28 15:06:30 +0800

Hi Darksu,

I am Bakkar, I had to use the company account now.

First of all thank you for your patience, ZK is new for me and I am still trying to figure out how it works.

I thought it is something related to configuration, because I have made a full search in the system, searching for the word "mobile". In all places that it found a match I've changed accordingly like in the Index.java there was the following code:

isMobile = Executions.getCurrent().getBrowser("mobile") !=null;
I changed it to
isMobile = false; //Executions.getCurrent().getBrowser("mobile") !=null;

From the above code change i believe i told the system that its always not a mobile device but still giving the same result.

The system is doing the following when it detects it's being accessed from a tablet:

  • in the body element is adding the class "mobile" <body class="safari safari537 **mobile** ios breeze" cz-shortcut-listen="true">
  • A new css is being added (tablet.css.dsp) and i can't find it anywhere in the system <link rel="stylesheet" type="text/css" href="/blu/zkau/web/3188310c/zkmax/css/tablet.css.dsp">
  • Elements changed their css classes "z-button-os" to "z-button" "z-window-embedded-noborder" to "z-window-embedded"

Thanks Again

link publish delete flag offensive edit
0

answered 2015-03-02 01:46:41 +0800

JustinFrost gravatar image JustinFrost
139 1 6

Moreno,

If you are referring to the custom styles zk adds on mobile devices, you can modify your WEB-INF/zk.xml file to remove these by adding the following:

<!-- Use the same styles regardless of device -->
<library-property>
    <name>org.zkoss.zkmax.tablet.ui.disabled</name>
    <value>true</value>
</library-property>

Hope this helps.

link publish delete flag offensive edit
0

answered 2015-03-02 19:40:34 +0800

moreno gravatar image moreno
0 1

I think that would work perfectly but according to the documentation its available for version 7.0 up and the version that the system is built on is 6.5.7. I still tried it but no result.

If maybe you know another way i would appreciate it.

Thanks very much

link publish delete flag offensive edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2015-02-27 22:53:00 +0800

Seen: 37 times

Last updated: Mar 02 '15

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More