From 274dee368cafd002cfb60b167f7faccef1667663 Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Wed, 30 Jul 2014 17:08:13 +0200 Subject: [PATCH] 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. --- src/jquery.gridster.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/jquery.gridster.js b/src/jquery.gridster.js index 7bac9118..81923f5e 100755 --- a/src/jquery.gridster.js +++ b/src/jquery.gridster.js @@ -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; };