add_resize_handle: multiple span (resizeable) entries in widgets

On init() or get_widgets_from_DOM() new span entries are added to the
widgets container.
This commit is contained in:
Stefan Schmidt
2014-07-30 17:08:13 +02:00
parent 1d06af1d5c
commit 274dee368c
+5 -2
View File
@@ -429,8 +429,11 @@
* @return {HTMLElement} Returns instance of gridster Class.
*/
fn.add_resize_handle = function($w) {
var append_to = this.options.resize.handle_append_to;
$(this.resize_handle_tpl).appendTo( append_to ? $(append_to, $w) : $w);
var $append_to = this.options.resize.handle_append_to ? $(this.options.resize.handle_append_to, $w) : $w;
if ( ($append_to.children("span[class~='" + this.resize_handle_class + "']")).length == 0 ) {
$(this.resize_handle_tpl).appendTo( $append_to );
}
return this;
};