From d4864b74edfcd79afc9f120e8b7df33c4665bd50 Mon Sep 17 00:00:00 2001 From: Ricky Blankenaufulland Date: Thu, 9 Mar 2017 14:58:30 +0100 Subject: [PATCH 1/3] 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 --- gridstack/gridstack-tests.ts | 6 +++++- gridstack/index.d.ts | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gridstack/gridstack-tests.ts b/gridstack/gridstack-tests.ts index 96aa14b19f..02e6c1597f 100644 --- a/gridstack/gridstack-tests.ts +++ b/gridstack/gridstack-tests.ts @@ -10,7 +10,11 @@ var options = { 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(); diff --git a/gridstack/index.d.ts b/gridstack/index.d.ts index 75056999e2..19e4bda280 100644 --- a/gridstack/index.d.ts +++ b/gridstack/index.d.ts @@ -4,7 +4,8 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface JQuery { - gridstack (options: IGridstackOptions):GridStack + gridstack (options: IGridstackOptions): JQuery; + data(key: "gridstack"): GridStack; } interface GridStack { From bd35ad182875e11c8c70c97d1bc40726a62e08e1 Mon Sep 17 00:00:00 2001 From: Ricky Blankenaufulland Date: Thu, 9 Mar 2017 14:59:27 +0100 Subject: [PATCH 2/3] added ZoolWay to the authors --- gridstack/gridstack-tests.ts | 1 + gridstack/index.d.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/gridstack/gridstack-tests.ts b/gridstack/gridstack-tests.ts index 02e6c1597f..0546bab506 100644 --- a/gridstack/gridstack-tests.ts +++ b/gridstack/gridstack-tests.ts @@ -5,6 +5,7 @@ // Type definitions for Gridstack // Project: http://troolee.github.io/gridstack.js/ // Definitions by: Pascal Senn +// Definitions by: Ricky Blankenaufulland // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped var options = { diff --git a/gridstack/index.d.ts b/gridstack/index.d.ts index 19e4bda280..7f557f4af6 100644 --- a/gridstack/index.d.ts +++ b/gridstack/index.d.ts @@ -1,6 +1,7 @@ // Type definitions for Gridstack // Project: http://troolee.github.io/gridstack.js/ // Definitions by: Pascal Senn +// Definitions by: Ricky Blankenaufulland // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface JQuery { From 9ada494d064c9c0451059a3220907eb493b48dd3 Mon Sep 17 00:00:00 2001 From: Ricky Blankenaufulland Date: Wed, 15 Mar 2017 11:47:50 +0100 Subject: [PATCH 3/3] fixed 'Definitions by' file headers --- gridstack/gridstack-tests.ts | 3 +-- gridstack/index.d.ts | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/gridstack/gridstack-tests.ts b/gridstack/gridstack-tests.ts index 0546bab506..9330d2019e 100644 --- a/gridstack/gridstack-tests.ts +++ b/gridstack/gridstack-tests.ts @@ -4,8 +4,7 @@ // Type definitions for Gridstack // Project: http://troolee.github.io/gridstack.js/ -// Definitions by: Pascal Senn -// Definitions by: Ricky Blankenaufulland +// Definitions by: Pascal Senn , Ricky Blankenaufulland // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped var options = { diff --git a/gridstack/index.d.ts b/gridstack/index.d.ts index 7f557f4af6..17e4d43863 100644 --- a/gridstack/index.d.ts +++ b/gridstack/index.d.ts @@ -1,7 +1,6 @@ // Type definitions for Gridstack // Project: http://troolee.github.io/gridstack.js/ -// Definitions by: Pascal Senn -// Definitions by: Ricky Blankenaufulland +// Definitions by: Pascal Senn , Ricky Blankenaufulland // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped interface JQuery {