angular-gridster2 icon indicating copy to clipboard operation
angular-gridster2 copied to clipboard

moveUpTillCollision called on gridster instead of vm

Open adammatthewsmith opened this issue 9 years ago • 3 comments

On version 1.11.3. Enabling the compactUp options causes an error to be thrown at line 1786 of the distribution gridster.js in the checkCompactUp function. The function is calling moveUpTillCollision on the gridster object that is passed in to GridsterCollision, but I believe it should be calling the function on the vm variable. After making the change locally it works again.

If you prefer a pull request I can try to get around to it later.

vm.checkCompactUp = function checkCompactUp() {
        var widgetMovedUp = false, widget, moved;
        var l = gridster.grid.length;
        for (var i = 0; i < l; i++) {
          widget = gridster.grid[i];
          // This appears to be the issue.  gridster should be vm.
          moved = gridster.moveUpTillCollision(widget);
          if (moved) {
            widgetMovedUp = true;
            widget.item.y = widget.$item.y;
            widget.itemChanged();
          }
        }
        if (widgetMovedUp) {
          vm.checkCompactUp();
        }
        return widgetMovedUp;
      };

adammatthewsmith avatar Aug 18 '17 15:08 adammatthewsmith

Hi @adammatthewsmith , Ups, yeah a small fuck up on last patch version. Will try to make a new version fix today.

Thanks,

tiberiuzuld avatar Aug 18 '17 15:08 tiberiuzuld

Hi @adammatthewsmith , Fixed v1.11.4

Thanks,

tiberiuzuld avatar Aug 20 '17 09:08 tiberiuzuld

Awesome! Thanks for the quick fix.

adammatthewsmith avatar Aug 21 '17 14:08 adammatthewsmith