From 7ad1b21fe960f755ba8ee11c25d053e65fe40510 Mon Sep 17 00:00:00 2001 From: Patrick Desjardins Date: Wed, 4 Mar 2015 14:30:19 -0800 Subject: [PATCH] Remove the need of not necessary Html Element The current situation force the user to have a not necessary creation of an HtmlElement object. In fact, you do not need. JQuery Gridster has a plugin that take a single parameter which is the option. This is why that Pull Request fix this issue but also the issue that when debugging the unit test you can see that the injected options were the HtmlElement instead of the real options. --- jquery.gridster/gridster-tests.ts | 4 +--- jquery.gridster/gridster.d.ts | 3 +-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/jquery.gridster/gridster-tests.ts b/jquery.gridster/gridster-tests.ts index 1521b205da..72c90a6f08 100644 --- a/jquery.gridster/gridster-tests.ts +++ b/jquery.gridster/gridster-tests.ts @@ -1,7 +1,5 @@ /// -var el: HTMLElement = new HTMLElement(); - interface SerializeData { x?: number; y?: number; @@ -18,7 +16,7 @@ var options: GridsterOptions = { } }; -var gridster = $('.gridster ul').gridster(el, options).data('grister'); +var gridster = $('.gridster ul').gridster(options).data('grister'); gridster.add_widget('
  • The HTML of the widget...
  • ', 2, 1); gridster.remove_widget($('gridster li').eq(3).get(0)); var json = gridster.serialize(); diff --git a/jquery.gridster/gridster.d.ts b/jquery.gridster/gridster.d.ts index b293dcb2fa..53f26704e3 100644 --- a/jquery.gridster/gridster.d.ts +++ b/jquery.gridster/gridster.d.ts @@ -160,11 +160,10 @@ interface JQuery { /** * Gridster - * @param el The HTMLElement that contains all the widgets. * @param options An object with all the gridster options you want to overwrite. * @return Gridster jQuery instance. **/ - gridster(el: HTMLElement, options?: GridsterOptions): JQuery; + gridster(options?: GridsterOptions): JQuery; } interface Gridster {