Skip to content

Only last grid is updated on resize #4

@MonsieurLanza

Description

@MonsieurLanza

Hello there,

When using multiple grids with same selector, only the last one will be updated on resize. If you have n grids, the last one will be updated n times.

As far as I understand problem is here :

        for (var i=0;i<grids.length;i++) {
            var grid = grids[i], 
            [...]
            makeGrid(grid, items, o); // <- this call is ok
            var tempf = function() {  makeGrid(grid, items, o); }; // <- this call will not be ok as it is deferred. 
            [...]
        }

"grid" in this function is not a copy of for loop's "grid", it IS the for loop's "grid". So when the event will be fired later on, grid will always have the current "grid" value of the for loop, which already has ended looping long ago => I will always be the last grid.

I may give this a try, but I do not see an easy fix this evening.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions