Options for mobile phones
Just a question, maybe it's easy to implement (havent checked the related code details yet):
I'd like to force the usage of "click menu" instead of the hover menus for mobile phones. Is it just the javascript var use_click_menu that needs to be true? How would I check, if the device (browser) is from a mobile phone?
Re: Options for mobile phones
Reply #1 –
Yep, should be the only value.
I don't think we have any mobile detection in javascript, but we can drop in a variable from the php detection I think.
Alternatively you can do some "responsive-like" javascript measuring the width of the screen (and/or attaching an event to resize or whatever is called, but maybe that's not necessary) and set the variable accordingly.
Re: Options for mobile phones
Reply #2 –
Yup, all you should have to do is set that var and the click menus will activate.
We don't have specific mobile capability detection, ("robust" detection), but the UA quick sniff does its best to check for the following mobile type devices 'is_iphone' , is_android, 'is_blackberry' , 'is_nokia', 'is_ipad', is_tablet_pc, is_ie_mobi, 'is_opera_mobi' etc.
One easy way to check what it finds is that it will set $context['browser_body_id'] to 'mobile' or 'tablet' if it feels that is what is being used, otherwise it will have the more standard firefox, chrome, etc. I don't think we have a generic isBrowser('is_mobile') check but one could be added, so till then just use if $context['browser_body_id'] === 'mobile' as a start