Forums Forums Search & Filter Pro AJAX initialization In Safari

Viewing 10 posts - 1 through 10 (of 10 total)
  • Ross Moderator
    #2287

    Hey Highfilter, I’ll test this as soon as I can and see if I can provide a temporary workaround while I look at the issue.

    Thanks

    Anonymous
    #2316

    Perfect, really appreciate it. ๐Ÿ™‚

    Anonymous
    #2568

    Any updates on this?

    Test case would be:

    – Create a page called Custom Search, url: /custom-search
    – Embed shortcode from Search & Filter into the ‘page-custom-search.php’
    – In Search & Filter settings, check ‘Use a custom template for results?”. Set the filename to ‘page-custom-search.php’ and set the “Set a slug?” field to ‘custom-search’.
    – Make sure AJAX is on in Search & Filter.

    When you view the Custom Search page in Safari, you’ll get a refresh on the form for no reason. Even if there’s a pager in the results and you switch pages, it will refresh the page again after it loads.

    Ross Moderator
    #2622

    Hey highfilter

    I managed to have a look at the weekend and found the issue you were talking about but haven’t managed to patch a fix for it just yet :/

    I’ll let you know when I do – to be honest I can’t even supply a workaround as I haven’t managed to get it working yet…

    Will keep you updated, apologies for the wait..

    Ross Moderator
    #2891

    Hey highfilter, I’m hopeful I can push a fix for this tonight ๐Ÿ™‚

    Ross Moderator
    #2960

    Hey highfilter, I’ve added an initialisation hook which hopefully will help you – this will be released in the latest update (in a few hours time).

    This is how you use it:

    	$(".searchandfilter").on("sf:init",function(){
    		console.log("search form init!");
    	});

    Let me know, once I’ve released it if this works for you ๐Ÿ™‚

    Anonymous
    #2996

    Hey there,

    it doesn’t seem to be working. If I set a log message to show up on init, I can see it, but it seems to be too late or too early. If you have a pager for example, and change pages, the init will run but the form seems to just reload. For example, try adding a class to a <li> within the .searchandfilter, like so:

    
    $(".searchandfilter").on("sf:init",function(){
      console.log("search form init!");
      if($('.searchandfilter ul li.search-custom-class').length == 0) {
        $(".searchandfilter ul li").addClass("search-custom-class");
      }
    });
    

    If you switch pages or something that triggers the AJAX again, the class won’t be applied but you’ll see the console log fire.

    Thanks for your help.

    Ross Moderator
    #3055

    Hey highfilter

    The only thing I can think of is that your search form is inside your Ajax content selector? Make sure your form is not inside this content area and I’m hoping it will work for you?

    Alternatively, do you have the beta feature enabled in the settings box? Please make sure this is disabled :/

    Thanks

    Anonymous
    #3064

    In a page template, I have the shortcode in a div, outside the #content div. Content selector is “#content”.

    Setup is like:

    
    <div id="search-filter-cont">
      <?php echo do_shortcode('[searchandfilter id="438"]'); ?>
    </div>
    
    <div id="content">
      ...
    </div>
    

    I do not have the beta featured enabled either. Funny how it only doesn’t work properly in Safari. ๐Ÿ™

    Ross Moderator
    #3083

    Hey highfilter – it is strange – I didn’t manage to recreate the problem – is this on safari on a Mac?

    From what I can see are you only adding CSS styling to the form? If so, I think there will be a better way to do all this, using CSS only – I can help you with too.. for example all your styles under
    .search-custom-class you can just make a rule in your own CSS and add like this:

    .searchandfilter ul li
    {
        border:1px solid #f00;
        background-color:#0f0;
    }

    (Horrible choice of colours I know)

    And if you are not seeing the styles being applied, then you could try adding important rules:

    .searchandfilter ul li
    {
        border:1px solid #f00 !important;
        background-color:#0f0 !important;
    }

    Let me know

Viewing 10 posts - 1 through 10 (of 10 total)