fixed how the GridStack object is obtained

jQuery plugins return the jQuery object, to get the plugin, also in the case of GridStack 0.2.6 (latest) you use the data() method with the correct name
This commit is contained in:
Ricky Blankenaufulland
2017-03-09 14:58:30 +01:00
parent ebbfed49ab
commit d4864b74ed
2 changed files with 7 additions and 2 deletions

View File

@@ -10,7 +10,11 @@
var options = <IGridstackOptions> {
float: true
};
var gridstack:GridStack = $(document).gridstack(options);
var element: JQuery = $(document).gridstack(options);
var gridstack: GridStack = $(document).data("gridstack");
var gsFromElement: GridStack = element.data("gridstack");
if (gridstack !== gsFromElement) throw Error('These should match!');
gridstack.addWidget("test", 1, 2, 3, 4, true);
gridstack.batchUpdate();