Skip to content

Add an async update function? #50

Open
@amcavinue

Description

@amcavinue

Does anyone have thoughts on being able to call gridly to update asynchronously?
See my video here:
https://www.youtube.com/watch?v=1DHcT4hNp4I

I'm using Gridly for the cards, but when the card opens I'd like to asynchronously call the update using the step method of jQuery's .slideDown (found here: http://api.jquery.com/slidedown/#slideDown-options ). See the code below for an illustration of this.

See how the card slides down, and then gridly updates the dom? I'd like to do that asynchronously. The step function would be called after jQuery calculates its element's position, and then Gridly would have to calculate where all its elements go just then. I already tried this with the way that Gridly is implemented now, but it did not work.

I'm motivated to implement this myself, but it would be appreciated if anyone can give me an idea of where to start in the code (like a description of how the element's positions are calculated). And if anyone has any ideas of exactly how to implement this it would be appreciated.

Here's sample code for how I'm updating the dom:

$.fn.expand = function($listItem) {
    var $subAccordion = $listItem.next('.list-item');
        $subAccordion.slideDown({
            duration: 350,
            queue: false,
            step: function() {
                $('.gridly').gridly();
            }
        });
};

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions