|
444 | 444 | * Change the size of a widget. Width is limited to the current grid width.
|
445 | 445 | *
|
446 | 446 | * @method resize_widget
|
447 |
| - * @param {HTMLElement} $widget The jQuery wrapped HTMLElement |
448 |
| - * representing the widget. |
| 447 | + * * @param {HTMLElement|$HTMLElement} el The widget HTMLElement, jQuery |
| 448 | + * wrapped or not, you want to resize. |
449 | 449 | * @param {Number} size_x The number of columns that will occupy the widget.
|
450 | 450 | * By default <code>size_x</code> is limited to the space available from
|
451 | 451 | * the column where the widget begins, until the last column to the right.
|
452 | 452 | * @param {Number} size_y The number of rows that will occupy the widget.
|
453 | 453 | * @param {Function} [callback] Function executed when the widget is removed.
|
454 | 454 | * @return {HTMLElement} Returns $widget.
|
455 | 455 | */
|
456 |
| - fn.resize_widget = function($widget, size_x, size_y, callback) { |
| 456 | + fn.resize_widget = function(el, size_x, size_y, callback) { |
| 457 | + var $widget = el instanceof $ ? el : $(el); |
457 | 458 | var wgd = $widget.coords().grid;
|
458 | 459 | var col = wgd.col;
|
459 | 460 | var max_cols = this.options.max_cols;
|
|
719 | 720 | * Remove a widget from the grid.
|
720 | 721 | *
|
721 | 722 | * @method remove_widget
|
722 |
| - * @param {HTMLElement} el The jQuery wrapped HTMLElement you want to remove. |
| 723 | + * @param {HTMLElement|$HTMLElement} el The widget HTMLElement, jQuery wrapped |
| 724 | + * or not, you want to remove. |
723 | 725 | * @param {Boolean|Function} silent If true, widgets below the removed one
|
724 | 726 | * will not move up. If a Function is passed it will be used as callback.
|
725 | 727 | * @param {Function} callback Function executed when the widget is removed.
|
|
0 commit comments