tmrudick/angular-gridster — pull request #11 by bsmithgall (2014-12-08 23:19:33+00:00)
Title: changed callback to include a label param for identifying different events

Something that was missing from this was the ability to differentiate between different types of events (resize vs. drag), which have slightly different implementations in the underlying gridster API.

In the current implementation, a *resize* event will fire the `serialize` method continuously, but the actual broadcast will be limited by the `if ($widget)`. A *dragged* event will only fire on stop. This leads to some trickiness when attempting to have slightly different logic for handling dragging and resizing (controlling the number/frequency of AJAX requests sent, for example). This is a patch.

There are some open questions: `if ($widget || (callback.label === 'dragged' && ui.$player ))` is a bit of hack. `$widget` never comes into the arguments on that serialization function, which I imagine is due to differences in the implementation of the [`resize`](http://gridster.net/docs/files/src_jquery.gridster.js.html#l994) and [`drag`](http://gridster.net/docs/files/src_jquery.gridster.js.html#l964) stop methods. I don't really know how to fix that.

Comments appreciated!