From cda560f4f3ca616d03d1e3230cd2ef4e69876d9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20S=C3=A1nchez-Mar=C3=ADn?= Date: Thu, 16 Apr 2015 18:54:53 +0200 Subject: [PATCH] fix(gridster): `resize_widget` also accepts HTMLElements for consistency with the `remove_widget` --- src/jquery.gridster.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index 1d0a12aa10..79bd941511 100755 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -444,8 +444,8 @@ * Change the size of a widget. Width is limited to the current grid width. * * @method resize_widget - * @param {HTMLElement} $widget The jQuery wrapped HTMLElement - * representing the widget. + * * @param {HTMLElement|$HTMLElement} el The widget HTMLElement, jQuery + * wrapped or not, you want to resize. * @param {Number} size_x The number of columns that will occupy the widget. * By default size_x is limited to the space available from * the column where the widget begins, until the last column to the right. @@ -453,7 +453,8 @@ * @param {Function} [callback] Function executed when the widget is removed. * @return {HTMLElement} Returns $widget. */ - fn.resize_widget = function($widget, size_x, size_y, callback) { + fn.resize_widget = function(el, size_x, size_y, callback) { + var $widget = el instanceof $ ? el : $(el); var wgd = $widget.coords().grid; var col = wgd.col; var max_cols = this.options.max_cols; @@ -719,7 +720,8 @@ * Remove a widget from the grid. * * @method remove_widget - * @param {HTMLElement} el The jQuery wrapped HTMLElement you want to remove. + * @param {HTMLElement|$HTMLElement} el The widget HTMLElement, jQuery wrapped + * or not, you want to remove. * @param {Boolean|Function} silent If true, widgets below the removed one * will not move up. If a Function is passed it will be used as callback. * @param {Function} callback Function executed when the widget is removed.