NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: trent on April 22, 2014, 10:25:32 PM
-
Hi Bruce,
Is there any way to suppress tool tips in desktop mode when the device is a tablet?
Regards,
Trent
-
Suppressing tips is easy; set
p_web.site.notips = true
I'd do this in the webHandler, ProcessLink method, before the parent call.
Figuring out if the user is on a tablet is harder. More specifically, when is a tablet not a tablet? For example, a surface pro with a keyboard and mouse. Is that still a tablet?
but let's pick the low-hanging fruit of Android and iOS.
if p_web.IsMenuTouch()
p_web.site.notips = true
end
cheers
Bruce
-
That's awesome thanks Bruce!
I was testing the screen width using javascript to load desktop mode if mobile mode was set and the screen width is larger than a standard mobile phone width:
<script type="text/javascript">
$(document).ready(function(){
if ($(window).width() > 600) {
SetSessionValue('tablet',1);
window.open("LoginForm?_mobile_=0","_self");
}
});
</script>
That stops mobile mode from loading automatically on a tablet. BUT p_web.IsMenuTouch() seems easier. What does it do exactly?
Regards,
Trent
-
check out netweb.clw and you'll see the code. It's not going to work everywhere (especially devices like Surface which have a mouse and Touch) but it deals with the obvious stuff in the short term.
-
Ahh I see, thanks Bruce.
-
Hi Bruce,
Just tested this with an iPad and it is not working. Looking at the User-Agent string that is coming in from the iPad, the IsMenuTouch() method isn't able to correctly match for an iPad.
IsMenuTouch currently looks for:
instring('ipad ',self._useragent,1,1)
...but the User-Agent string of this particular iPad was:
User-Agent: Mozilla/5.0 (iPad; CPU OS 7_1 like Mac OS X) AppleWebKit...
I think you may want to remove the space in each of the 'instring' check of this method so they look like:
instring('ipad',self._useragent,1,1)
Regards,
Trent
-
done
-
Awesome, thank you!