Forums › Forums › Search & Filter Pro › AJAX initialization In Safari
- This topic has 10 replies, 2 voices, and was last updated 11 years, 1 month ago by
Ross.
-
Ross Moderator(Private) July 9, 2014 at 1:20 pm #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(Private) July 16, 2014 at 4:24 pm #2568Any 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(Private) July 17, 2014 at 8:50 pm #2622Hey 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(Private) July 24, 2014 at 1:46 pm #2891Hey highfilter, I’m hopeful I can push a fix for this tonight ๐
Ross Moderator(Private) July 27, 2014 at 9:06 pm #2960Hey 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(Private) July 28, 2014 at 5:46 pm #2996Hey 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(Private) July 29, 2014 at 1:32 pm #3055Hey 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(Private) July 29, 2014 at 7:36 pm #3064In 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(Private) July 31, 2014 at 1:46 pm #3083Hey 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
-
AuthorPosts