mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
remove_widget accepts a callback as second argument
This commit is contained in:
@@ -221,7 +221,7 @@
|
|||||||
* @param {HTMLElement} el The jQuery wrapped HTMLElement you want to remove.
|
* @param {HTMLElement} el The jQuery wrapped HTMLElement you want to remove.
|
||||||
* @return {Class} Returns the instance of the Gridster Class.
|
* @return {Class} Returns the instance of the Gridster Class.
|
||||||
*/
|
*/
|
||||||
fn.remove_widget = function(el) {
|
fn.remove_widget = function(el, callback) {
|
||||||
var $el = el instanceof jQuery ? el : $(el);
|
var $el = el instanceof jQuery ? el : $(el);
|
||||||
var wgd = $el.coords().grid;
|
var wgd = $el.coords().grid;
|
||||||
|
|
||||||
@@ -237,6 +237,10 @@
|
|||||||
this.move_widget_up( $(widget), wgd.size_y );
|
this.move_widget_up( $(widget), wgd.size_y );
|
||||||
}, this));
|
}, this));
|
||||||
}, this));
|
}, this));
|
||||||
|
|
||||||
|
if (callback) {
|
||||||
|
callback.apply(el);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user