mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Resizable: Keep user-provided handles on destroy
Closes gh-1798 Ref gh-1795
This commit is contained in:
parent
c6e2b52d70
commit
c426b9a203
@ -434,8 +434,10 @@ QUnit.test( "zIndex, applied to all handles", function( assert ) {
|
||||
} );
|
||||
|
||||
QUnit.test( "setOption handles", function( assert ) {
|
||||
assert.expect( 15 );
|
||||
assert.expect( 19 );
|
||||
|
||||
// https://bugs.jqueryui.com/ticket/3423
|
||||
// https://bugs.jqueryui.com/ticket/15084
|
||||
var target = $( "<div></div>" ).resizable(),
|
||||
target2 = $( "<div>" +
|
||||
"<div class='ui-resizable-handle ui-resizable-e'></div>" +
|
||||
@ -470,6 +472,12 @@ QUnit.test( "setOption handles", function( assert ) {
|
||||
|
||||
target2.resizable( "option", "handles", "e, s, w" );
|
||||
checkHandles( target2, [ "e", "s", "w" ] );
|
||||
|
||||
target.resizable( "destroy" );
|
||||
checkHandles( target, [ ] );
|
||||
|
||||
target2.resizable( "destroy" );
|
||||
checkHandles( target2, [ "e", "w" ] );
|
||||
} );
|
||||
|
||||
QUnit.test( "alsoResize + containment", function( assert ) {
|
||||
|
@ -187,15 +187,14 @@ $.widget( "ui.resizable", $.ui.mouse, {
|
||||
_destroy: function() {
|
||||
|
||||
this._mouseDestroy();
|
||||
this._addedHandles.remove();
|
||||
|
||||
var wrapper,
|
||||
_destroy = function( exp ) {
|
||||
$( exp )
|
||||
.removeData( "resizable" )
|
||||
.removeData( "ui-resizable" )
|
||||
.off( ".resizable" )
|
||||
.find( ".ui-resizable-handle" )
|
||||
.remove();
|
||||
.off( ".resizable" );
|
||||
};
|
||||
|
||||
// TODO: Unwrap at same DOM position
|
||||
|
Loading…
Reference in New Issue
Block a user