-
-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
trigger('refreshWookmark) not working #196
Comments
You have to call the refresh on the initalised wookmark container since version 2.0. For example
|
Thanks! That helped and the search now works as a "filter", but refreshWookmark will not trigger until after a change in window size. |
I don't know why refreshWookmark only works after a change in window size but I was able to get things working by just calling
in a callback, like this:
|
@macsupport yes I think I know why. Calling I will fix this soon in 2.0.2. |
Thanks. Here is a Demo of the search function working, and using Photoswipe as the image lightbox with Wookmark. Thanks for a great plugin! |
Any update on this? Thanks! |
Update? |
Hi, sorry I'm a bit busy lately. I already tried finding a solution and found a big issue with the events. Will get back on that in the next days. |
As a workaround, on resize I destroy wookmark and then re-initialize it. And if I remember right, I think I had to physically remove the DOM element and then re-add it to really clear things out. This is all super dirty but it works. |
// Update the layout.
// Jquery Object
var $wookmark = $('#container').wookmark({....});
wookmark.wookmarkInstance.initItems();
wookmark.wookmarkInstance.layout(true);
//JavaScript new
var wookmark = new Wookmark(container);
wookmark.initItems();
wookmark.layout(true); |
Be careful that doesn't work currently when you initialize several instances with one call. |
I simply just used |
Scratch that, using the above code multiple times causes the browser to crash due to a "maximum call stack size exceeded" error. |
Both events can now be triggered manually with or without jQuery. See readme.md on how to do it. Relates: #196
Both events can now be triggered manually with or without jQuery. See readme.md on how to do it. Relates: #196
Hey all, @zilions I didn't get this error, do you have an example on how to get this error? |
I believe the error occurs when the event is called multiple times while it is still running. For example, not 100% sure if this would show the error, but guessing it would:
|
I am working on a simple search option using quicksearch. It uses some callbacks to show and hide items. The show and hide works but the refreshWookmark call does not.
The text was updated successfully, but these errors were encountered: