Mobile FF accept cookies and page display issues

tim
Founder
Nuo Sweden
Narys nuo geg. 2013
tim

Can you see if the developer console logs a javascript error when you click the OK button?

I have been searching for a method to disable the Featherlight for mobile. You can turn the modal off completely under Appearance until there is a better solution available.

Firefox is the new Internet Explorer. Meaning everytime there is an odd browser behavior, it's always Firefox these days. I dunno how stable their mobile apps are?

Deleted
Nuo Nežinoma

I dont use the mobile development platform; just netbeans IDE.
Ive made some changes which seem to work OK dunno if you approve:
func_draw.inc.php ; add to top and include Mobile_Detect.php in classes:

?php
// Include the class.
require_once FS_DIR_HTTP_ROOT . WS_DIR_CLASSES . 'Mobile_Detect.php';

// about line 115 in func_draw.php

function draw_lightbox($selector='*[data-toggle="lightbox"]', $params=array()) {
 $detect = new Mobile_Detect;
//determine if mobile or tablet and draw full screen if true

 if ($detect->isMobile() || $detect->isTablet()) {$selector='a.lightbox';}
 else { $selector = str_replace("'", '"', $selector);}
Deleted
Nuo Nežinoma

Whoops a glitch if an image is clicked on the close button has gone :-(  

tim
Founder
Nuo Sweden
Narys nuo geg. 2013
tim

I'm trying to cut down on third party libraries. Mobile Detect will become outdated very fast.

You could add a general beforeOpen event that checks screen width. Something like this in func_draw.inc.php:


    $default_params = array(
      'loading'     => '',
      'closeIcon'   => '✖',
      'targetAttr'  => 'data-target',
      'beforeOpen'  => 'function(){ if ($(window).width() < 768) return false; }', //
Deleted
Nuo Nežinoma

Yes that works and was a method I used to use but there is lots of discussion about detecting mobiles and the general consensus is that method ismobile.php is most reliable. I do like the window size method better to keep it simple.

So say we have if (!$default_params['beforeOpen']) what method do you suggest to use to reliably control the Featherlight function?

Deleted
Nuo Nežinoma

Hmm all I needed was to clear the cache on mobile device (couldnt test on desktop) - it works but we still have the problem of no close button on modal image graphic when mobile screen is detected.

Deleted
Nuo Nežinoma

Still an issue with: Cookies acceptance keeps repeating
as above; only on mobile.
Click [OK] message disappears, go to another page, then back Home and message reappears only on mobile.

LiteCart Fan
Nuo France
Narys nuo saus. 2015

I agree with TIM for firefox, it looks like a new IE. I've got a lots of css mods for IE, IE Edge and Mozilla. It's awful.

But you can solve the problem of featherlight quite easily.
Another solution (I'm using this solution in my 2.0.2-prod and 2.1-dev webshop ):

1.add a function wherever you want, but before loading featherlight : it can be directly in default.inc.php, via an external script in /ext, and so on, several solutions possible.
function isMobile() {//mobile detection}, google for that

and a javascript detection of screen resolution
var w = window,
d = document,
e = d.documentElement,
g = d.getElementsByTagName('body')[0],
x = w.innerWidth || e.clientWidth || g.clientWidth,
y = w.innerHeight|| e.clientHeight|| g.clientHeight;

  1. in /ext/featherlight.js, find the line "open: function(event){" and add something like this after:
    open: function(event){
                          if (event && (event.ctrlKey || event.shiftKey)) return false;

                      if (isMobile()||(x < 768)) return false; 

tim
Founder
Nuo Sweden
Narys nuo geg. 2013
tim

Thank your for providing your solution.

The next version of LiteCart will have a parameter to control wheither or not to use Featherlight on an individual anchor level.

LiteCart Fan
Nuo France
Narys nuo saus. 2015

yes I know, but I've found a bug with that. From my memory, as far as I know, it doesn't work in box_product. Worse, it opens the picture in the self window instead of doing nothing, even on desktop screen. I've patched again with my Method to solve the problem.

This thread has been closed due to long inactivity. Posting to it is not possible.
This website uses no cookies and no third party tracking technology. We think we can do better than others and really think about your privacy.