Hi,
I'm experiencing some problems with shadowbox and views.
I set up a table listing with imagefield as shadowbox, node title, etc.... and some exposed filters.
I enabled ajax in my view setup to have ajax pagination, table ordering and ajax exposed filters.
Shadowbox works correctly when I go to the page, but if I do a view ajax call (change pagination, exposed filter search or table ordering). Then, if I click on my image, shadowbox stop working and my image is opened normally, as a link.
I think shadowbox need to have a jquery trigger that take care of views. Maybe an ajaxComplete call or something like that.
Comments
Comment #1
paulvantuyl commentedThis problem also happens if you click on a shadowbox link before a page is finished loading. It would be really good if somehow the link didn't work until the page was finished loading so that it always opens in shadowbox. Also, if you click on a shadowbox link for a .flv before the page is finished loading, Firefox asks you if you want to open or save the file. No good for me...
Comment #2
psynaptic commentedHey zmove, sorry to not get back to you on this sooner..
I'm not sure how to fix this. If you have any code I could use that would be awesome.
I've committed a fix for the problem mrMaze is talking about. He found that using document.ready worked better than window.load. This might have an effect on the issue you mentioned but I doubt it. Any more info would be much appreciated.
Comment #3
zmove commentedHi,
Yes, I noticed that document.ready was better than window.load. I find a beginining of fix using the jquery ajaxComplete trigger, but I never completely fixed it.
I'm on another project now, so I stopped working on this.
Comment #4
psynaptic commentedAhh, if you end up going back to it I would love to know how you tackled it. Thanks anyway.
Comment #5
psynaptic commentedComment #6
psynaptic commentedI fixed the issue with the content not being opened in Shadowbox if the Dom was not ready. I'd still love to find a fix for the ajax views issue.
Comment #7
druryjeff commentedNot sure if this is helpful or not, but it should point you in the right direction. I'm using the jQuery Pagination plug-in (straight, with no Drupal module) to display a series of panels containing links to videos that display using Shadowbox. As with the other folks on this post, after the first page link is clicked the Shadowbox links stop working (the videos are loaded on separate pages instead of in a Shadowbox/modal window).
To remedy this, you need to re-run the Shadowbox setup when page links are clicked. I did this by adding a call to the
Shadowbox.setup();function inside thepageSelected();function inside my jquery.pagination.js file.The modified function looks something like this:
Comment #8
psynaptic commentedWould love a patch for this!
Comment #9
jwaxman commentedI had the same problem.
I just put
in the footer of the view with PHP input format and all is well.
Not elegant but ...
Comment #10
phayes commentedThis is super-duper easy to fix. shadowbox_auto.js should be as follows:
The only change is that I added shadowbox.setup(); at the bottom of the behavior. This behavior is called on every ajax or AHAH reload - so this means that shadowbox will be re-triggered on every new piece of content. I could do this up as a patch if the maintainers want, but it's such a simple fix.
Comment #11
nicholas.alipaz commentedcan you create a patch for this against the latest version of shadowbox dev? http://drupal.org/patch/create
Comment #12
ericdfields commentedDoes this really need a patch? I just called Shadowbox.setup() as part of my callback.
And it works.
Now I just need similar for activating AJAX pagination in the view I'm loading up there too…
Comment #13
ericdfields commentedOK so a little tweaking to how we're setting up our site and it turns out the fix was needed after all!
Created a patch. Attached.
Comment #14
nicholas.alipaz commentedThis has been committed to the latest dev version of 4.x branch. 4.x is really the suggested branch currently so I will leave it to just that. If we need it commited to 3.x or 2.x then please reopen this issue although it would be is a pretty minor issue to create a new release in those branches for this.
http://drupal.org/cvs?commit=349750
Comment #16
Frederic wbase commentedIs the same already done for the 7.x version?
Everything you put in a theme behavior will autoreload if you perform an ajax call ;-)