mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-10-05 01:44:18 +00:00
Resizable: Made handles work with complex markup. Fixes #8756 - Resizable: Complex markup for handles.
This commit is contained in:
parent
6874f19061
commit
0bff32a2b1
@ -129,4 +129,24 @@ test("nw", function() {
|
|||||||
equal( target.height(), 100, "compare height" );
|
equal( target.height(), 100, "compare height" );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("handle with complex markup (#8756)", function() {
|
||||||
|
expect(2);
|
||||||
|
|
||||||
|
$('#resizable1')
|
||||||
|
.append(
|
||||||
|
$('<div>')
|
||||||
|
.addClass("ui-resizable-handle")
|
||||||
|
.addClass("ui-resizable-w")
|
||||||
|
.append($('<div>'))
|
||||||
|
);
|
||||||
|
|
||||||
|
var handle = '.ui-resizable-w div', target = $('#resizable1').resizable({ handles: 'all' });
|
||||||
|
|
||||||
|
TestHelpers.resizable.drag(handle, -50);
|
||||||
|
equal( target.width(), 150, "compare width" );
|
||||||
|
|
||||||
|
TestHelpers.resizable.drag(handle, 50);
|
||||||
|
equal( target.width(), 100, "compare width" );
|
||||||
|
});
|
||||||
|
|
||||||
})(jQuery);
|
})(jQuery);
|
||||||
|
9
ui/jquery.ui.resizable.js
vendored
9
ui/jquery.ui.resizable.js
vendored
@ -231,14 +231,15 @@ $.widget("ui.resizable", $.ui.mouse, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
_mouseCapture: function(event) {
|
_mouseCapture: function(event) {
|
||||||
var handle = false;
|
var capture = false;
|
||||||
for (var i in this.handles) {
|
for (var i in this.handles) {
|
||||||
if ($(this.handles[i])[0] == event.target) {
|
var handle = $(this.handles[i])[0];
|
||||||
handle = true;
|
if (handle == event.target || $.contains(handle, event.target)) {
|
||||||
|
capture = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return !this.options.disabled && handle;
|
return !this.options.disabled && capture;
|
||||||
},
|
},
|
||||||
|
|
||||||
_mouseStart: function(event) {
|
_mouseStart: function(event) {
|
||||||
|
Loading…
Reference in New Issue
Block a user