mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #15085 from ZoolWay/master
Fixed that GridStack object is obtained from jQuery.data() method
This commit is contained in:
@@ -4,13 +4,17 @@
|
||||
|
||||
// Type definitions for Gridstack
|
||||
// Project: http://troolee.github.io/gridstack.js/
|
||||
// Definitions by: Pascal Senn <https://github.com/PascalSenn/>
|
||||
// Definitions by: Pascal Senn <https://github.com/PascalSenn/>, Ricky Blankenaufulland <https://github.com/ZoolWay/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
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();
|
||||
|
||||
Vendored
+3
-2
@@ -1,10 +1,11 @@
|
||||
// Type definitions for Gridstack
|
||||
// Project: http://troolee.github.io/gridstack.js/
|
||||
// Definitions by: Pascal Senn <https://github.com/PascalSenn/>
|
||||
// Definitions by: Pascal Senn <https://github.com/PascalSenn/>, Ricky Blankenaufulland <https://github.com/ZoolWay/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface JQuery {
|
||||
gridstack (options: IGridstackOptions):GridStack
|
||||
gridstack (options: IGridstackOptions): JQuery;
|
||||
data(key: "gridstack"): GridStack;
|
||||
}
|
||||
|
||||
interface GridStack {
|
||||
|
||||
Reference in New Issue
Block a user