Open mconner opened 9 years ago
+1
+1
I've modified the gridster.resizable.stop and gridster.draggable.stop callbacks to return size and position objects ({ sizeX: item.sizeX, sizeY: item.sizeY } and { row: row, col: col }).
I've also modified the gridster.resizable.start and gridster.draggable.start callbacks to return size and position so that I can compare the original size/position values with the final values (from stop).
+1
+1
Like the above, when using a custom map object, then the map object is returned as "widget" in resize event. And when using a custom widget object without the necessary sizeX PositionX etc, and then using the attributes to map to the actual properties like so.
<div gridster>
<ul>
<li gridster-item row="item.position[0]" col="item.position[1]" size-x="item.size.x" size-y="item.size.y" ng-repeat="item in customItems"></li>
</ul>
</div>
Then the widget object returned as "widget" is the above element.
And when binding the correct widget object, that has the right sizeX positionY properties, then the bound object is returned in the resize function.
I would expect the behavior of the resize function to be the same, no matter if using a widget object, a custom map or mapping using the attributes. It should always be returning the "item" object.
When using a custom item map, the "widget" passed to the resize function is the map, rather than the original source object. For example, using the demo script.js, and adding:
to the resizable config. When doing a resize, the output is:
in resizeable.resize Object {sizeX: "item.size.x", sizeY: "item.size.y", row: "item.position[0]", col: "item.position[1]"}
I would think it should be the actual object, as defined in $scope.customItems[n]. For example:
I think this applies to the other callbacks, as well.