draggable, sortable: fixed issue when handle wasn't working with elements nested in the handle (fixes #2937)

This commit is contained in:
Paul Bakaus 2008-06-07 23:25:47 +00:00
parent 47e04b888d
commit 68d37568e0
2 changed files with 4 additions and 2 deletions

View File

@ -36,7 +36,9 @@ $.widget("ui.draggable", $.extend($.ui.mouse, {
if (this.helper || o.disabled || $(e.target).is('.ui-resizable-handle')) return false; 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; 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(this == e.target) handle = true;
}); });
if (!handle) return false; if (!handle) return false;

View File

@ -295,7 +295,7 @@ $.widget("ui.sortable", $.extend($.ui.mouse, {
if(!currentItem) return false; if(!currentItem) return false;
if(this.options.handle && !overrideHandle) { if(this.options.handle && !overrideHandle) {
var validHandle = false; 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; if(!validHandle) return false;
} }