Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Jorge Silva-Jetter

    (@jorgesilva-1)

    Hi DDDDvvVVV,

    Sorry for the delay, I’ve been super busy on other stuff latelty.

    This is a weird bug. I spent a lot of time architecturing this thing so that it would be backwards compatible. Can you go to Settings > JSJ Gallery Slideshow > Advanced > Log and then turn logging on.

    After you do that 1. go to your site, 2. open your console, 3. and run the function window. createJSJGallerySlideshow() manually and copy paste the output here.

    Here’s what I got on mine:

    automatically find and run slideshows jsj-gallery-slideshow.min.js:514
    [cycle2] –c2 init– jsj-gallery-slideshow.min.js:410
    [cycle2] cycle-stopped jsj-gallery-slideshow.min.js?ver=3.9.2:410
    [cycle2] cycle-stopped jsj-gallery-slideshow.min.js?ver=3.9.2:410
    [cycle2] cycle-destroyed jsj-gallery-slideshow.min.js?ver=3.9.2:410
    [cycle2] –c2 init– jsj-gallery-slideshow.min.js?ver=3.9.2:410
    window.createJSJGallerySlideshow();
    [cycle2] cycle-stopped jsj-gallery-slideshow.min.js?ver=3.9.2:410
    [cycle2] cycle-stopped jsj-gallery-slideshow.min.js?ver=3.9.2:410
    [cycle2] cycle-destroyed jsj-gallery-slideshow.min.js?ver=3.9.2:410
    [cycle2] –c2 init– jsj-gallery-slideshow.min.js?ver=3.9.2:410
    Object {init: function, getJQueryElement: function, get$el: function, settings: Object, utilities: Object…}

    Also, can you include a URL for this? That would help in debugging it. Thanks!

    Thread Starter DDDDvvVVV

    (@daverscho)

    Hi Jorge! No problem, thanks for the help.

    Here is a link to the page:
    https://bit.ly/1yHDNJR

    When I run the function on the page with the ajax content loaded:
    [Log] automatically find and run slideshows (jsj-gallery-slideshow.min.js, line 514)
    > window.createJSJGallerySlideshow();
    < Object

    Although, when I go to the post (opened in new tab), it works as expected:
    [Log] automatically find and run slideshows (jsj-gallery-slideshow.min.js, line 514)
    [Log] [cycle2] –c2 init– (jsj-gallery-slideshow.min.js, line 410)
    [Log] [cycle2] cycle-stopped (jsj-gallery-slideshow.min.js, line 410)
    [Log] [cycle2] cycle-stopped (jsj-gallery-slideshow.min.js, line 410)
    [Log] [cycle2] cycle-destroyed (jsj-gallery-slideshow.min.js, line 410)
    [Log] [cycle2] –c2 init– (jsj-gallery-slideshow.min.js, line 410)
    > window.createJSJGallerySlideshow();
    [Log] [cycle2] cycle-stopped (jsj-gallery-slideshow.min.js, line 410)
    [Log] [cycle2] cycle-stopped (jsj-gallery-slideshow.min.js, line 410)
    [Log] [cycle2] cycle-destroyed (jsj-gallery-slideshow.min.js, line 410)
    [Log] [cycle2] –c2 init– (jsj-gallery-slideshow.min.js, line 410)
    < Object

    On a related note, I discovered I can get the gallery to work when I load ‘jsj-gallery-slideshow.min.js’ again alongside the ajax content. I’m not sure why that makes it work since it’s already loaded.

    Plugin Author Jorge Silva-Jetter

    (@jorgesilva-1)

    Hi DDDDvvVVV,

    I know what’s happening! This is definitely a BUG!

    Basically, the plugin is caching the jQuery element. So it only looks for the slideshows on document.ready. When it loads new content through AJAX it’s still using the same jQuery elements and is not querying the DOM for new ones. This is a bug, since when you run the slideshow it should query new jQuery elements.

    Anyways, I’m going to work on this plugin for a bit this week. I’ll fix it in a couple of days and let you know. The next update should fix this.

    If you want to fix it yourself, you might need to setup grunt and stuff like that, but basically the fix is this:

    https://github.com/thejsj/jsj-gallery-slideshow/blob/master/static/js/app/main.js#L105-L110

    Change this:

    self.getJQueryElement = function () {
                if (__self.document_ready) {
                    return __self.$el;
                }
                return $(__self.selector);
            };

    for this:

    self.getJQueryElement = function () {
                return $(__self.selector);
            };

    I will probably make it so that if you do createJSJGallerySlideshow(true) it will requery the DOM for slideshow elements, so you might want to include that in your code.

    Thanks for the find!

    Thread Starter DDDDvvVVV

    (@daverscho)

    Thanks for the update, glad you were able to find what was happening. I may wait for the next update, since I’m not set up with Grunt or anything like that. It’s something I’ll check out in the meantime though. Thank you for your help!

    Plugin Author Jorge Silva-Jetter

    (@jorgesilva-1)

    Sounds good! Let me see when I can tackle that. Didn’t have time in the last couple of days.

    Plugin Author Jorge Silva-Jetter

    (@jorgesilva-1)

    This should be in for version 2.0.2. Give it a try and let me know if it worked for you!

    Thread Starter DDDDvvVVV

    (@daverscho)

    Wooo! The new update is working great. Thanks Jorge!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘AJAX content’ is closed to new replies.