metafizzy / packery

:bento: Gapless, draggable grid layouts
https://packery.metafizzy.co
4.13k stars 315 forks source link

Showing error with build code #477

Closed rkbansal closed 6 years ago

rkbansal commented 6 years ago

I have added function 'reArrange' in packery for personal use. It is showing '$().packery("reArrange") is not a valid method'. It is showing this error in build code. There is no usage of providing a reduce test case for this issue because it will be work fine in that. Any help will be great.

desandro commented 6 years ago

Thanks for reporting this issue. Can you post your code for reArrange ?

You can add your own custom methods like so:

// add custom method
Packery.prototype.reArrange = function() {
  // custom code...
};

// init Packery
var $grid = $('.grid').packery({...})

// use custom method
$grid.packery('reArrange');