From: Paul Bakaus Date: Sat, 7 Jun 2008 23:25:47 +0000 (+0000) Subject: draggable, sortable: fixed issue when handle wasn't working with elements nested... X-Git-Tag: 1.5.1~153 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=68d37568e0041290f3c957891c2c2919cd504f0f;p=jquery-ui.git draggable, sortable: fixed issue when handle wasn't working with elements nested in the handle (fixes #2937) --- diff --git a/ui/ui.draggable.js b/ui/ui.draggable.js index 8e670244b..d58e54100 100644 --- a/ui/ui.draggable.js +++ b/ui/ui.draggable.js @@ -36,7 +36,9 @@ $.widget("ui.draggable", $.extend($.ui.mouse, { if (this.helper || o.disabled || $(e.target).is('.ui-resizable-handle')) return false; var handle = !this.options.handle || !$(this.options.handle, this.element).length ? true : false; - if(!handle) $(this.options.handle, this.element).each(function() { + + + $(this.options.handle, this.element).find("*").andSelf().each(function() { if(this == e.target) handle = true; }); if (!handle) return false; diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js index a433805e8..cbfdd6623 100644 --- a/ui/ui.sortable.js +++ b/ui/ui.sortable.js @@ -295,7 +295,7 @@ $.widget("ui.sortable", $.extend($.ui.mouse, { if(!currentItem) return false; if(this.options.handle && !overrideHandle) { var validHandle = false; - $(this.options.handle, currentItem).each(function() { if(this == e.target) validHandle = true; }); + $(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == e.target) validHandle = true; }); if(!validHandle) return false; }