Skip to content
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

How to update layout once Wookmark has been called #206

Open
codehandling opened this issue Aug 2, 2015 · 2 comments
Open

How to update layout once Wookmark has been called #206

codehandling opened this issue Aug 2, 2015 · 2 comments
Labels
Milestone

Comments

@codehandling
Copy link

What is the right way to update Wookmark layout ?

I am using the jQuery call to Wookmark and I have tried the below to update the layout -

my_wookmark.layout(true);

my_wookmark.updateOptions();

Both give me the Error -
Uncaught TypeError: my_wookmark.layout is not a function

Snippet -

    var my_wookmark = $containerList.wookmark(options);


    $containerList.imagesLoaded().always(function() {

        console.log(my_wookmark);
        my_wookmark.layout(true);
        //my_wookmark.updateOptions();
             });
@codehandling
Copy link
Author

Also, is there a way I can re-layout the Wookmark grid on the page, if I do not have the woomkark object.

For example, in the previous versions (1.4.8), calling resize() on the window object used to call layout of the Wookmark as well.

$(window).resize();

This does not seem to work in the latest version

@Sebobo
Copy link
Member

Sebobo commented Aug 3, 2015

Thanks a lot for this issue.
This is not working anymore as it should.

jQuery doesn't seem to trigger the custom events added with addEventListener.
I have to investigate this further and maybe have to add additional event handlers for jQuery.

What you can do now would be this:

container.dispatchEvent(new CustomEvent("refreshWookmark"));
window.dispatchEvent(new CustomEvent("resize"));

@Sebobo Sebobo added the Bug label Mar 10, 2016
@Sebobo Sebobo added this to the 2.1.1 milestone Mar 10, 2016
@Sebobo Sebobo self-assigned this Mar 10, 2016
@Sebobo Sebobo modified the milestones: 2.1.2, 2.1.1 Apr 15, 2016
@Sebobo Sebobo removed their assignment May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants