Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #272216

    Hi Support team,

    I am using a filtering plugin on the following page (http://52kards.com/library/) so that users can search for specific types of videos. One issue is that if a user filters a certain parameter, then clicks on a video, and then hits the “back” button in his browser he will return back to the library, but the video grid on the page won’t display correctly.

    I spoke to the developer of the filtering plugin and he gave me the following solution:

    “Yes, that’s a bug with Enfold. Open themes/enfold/js/avia.js and change line ~647 from:
    if (fixedMainPadding > 0 && hash && apply_to_container == ‘body’)
    to:
    if (fixedMainPadding > 0 && hash && apply_to_container == ‘body’ && hash.charAt(1) != “!” ) ”

    This solution worked just fine in previous versions of Enfold, but I just updated to the latest release (2.8.1), and this fix no longer works. Do you have a possible solution to the problem?

    Thanks
    Asad

    #272263

    Hey AsadIC!

    I can’t test the page (I don’t see any videos here: http://52kards.com/library/ ) and not sure why the ! character would break the hash value but you can try to replace:

    
    			if (fixedMainPadding > 0 && hash && apply_to_container == 'body')
    			{
    				var scroll_to_el = $(hash);
    

    with

    
    			if (fixedMainPadding > 0 && hash && apply_to_container == 'body')
    			{
    				if(hash.indexOf("!") > -1) return;
    				var scroll_to_el = $(hash);
    

    If this code change doesn’t solve the issue please contact the plugin author.

    Cheers!
    Peter

    #272379

    Your modification didn’t fix the issue. I contacted the plugin developer and here’s what he said (it is beyond my understanding but maybe it will make sense to you).

    “If Enfold applied our original fix verbatim, the issue would be resolved. It doesn’t sound like they fully understand the issue.

    FacetWP uses “#!” as a hash instead of just “#” because it allows Google to automatically handle ajax. See: http://take.ms/zqPRi

    Enfold intercepts all URL hashes beginning with “#” for use with their built-in “scroll-to-top” functionality. This is breaking FacetWP’s ajax-permalink functionality.

    Reference: https://support.google.com/webmasters/answer/174992?hl=en”

    Asad

    #272577

    Hey Asad!

    Try commenting line 77-78 in js/avia.js:

    if($.fn.avia_smoothscroll)
    $('a[href*=#]', container).avia_smoothscroll(container);
    

    Regards,
    Josue

    #272641

    Commenting those lines seems to fix the issue in Firefox, but not in Chrome.

    Thanks
    Asad

    #272644

    The filter is working for me in Chrome:
    http://52kards.com/library/

    Try flushing your cache and checking again.

    Regards,
    Josue

    #274011

    Hi!
    I have added the initial solution to the script, makes sense to ignore ajax clicks ;)
    Regards,
    Kriesi

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘avia.js modification’ is closed to new replies.