Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 396086b

Browse files
committed
Merge pull request gridstack#52 from juchi/return_new_widgets
Return new widget on add_widget() call
2 parents 6b0afcb + ef311e6 commit 396086b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ $('.grid-stack').on('resizestop', function (event, ui) {
191191

192192
### add_widget(el, x, y, width, height, auto_position)
193193

194-
Creates new widget.
194+
Creates new widget and returns it.
195195

196196
Parameters:
197197

src/gridstack.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,8 @@
582582
this.container.append(el);
583583
this._prepare_element(el);
584584
this._update_container_height();
585+
586+
return el;
585587
};
586588

587589
GridStack.prototype.will_it_fit = function (x, y, width, height, auto_position) {

0 commit comments

Comments
 (0)