mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Selectmenu: Fall back to .ui-front searching for empty jQuery objects
Fixes #9757
This commit is contained in:
parent
8a71d0f129
commit
fa99e23d18
@ -3,7 +3,7 @@
|
|||||||
module( "selectmenu: options" );
|
module( "selectmenu: options" );
|
||||||
|
|
||||||
test( "appendTo another element", function () {
|
test( "appendTo another element", function () {
|
||||||
expect( 8 );
|
expect( 9 );
|
||||||
|
|
||||||
var detached = $( "<div>" ),
|
var detached = $( "<div>" ),
|
||||||
element = $( "#speed" ).selectmenu();
|
element = $( "#speed" ).selectmenu();
|
||||||
@ -21,6 +21,11 @@ test( "appendTo another element", function () {
|
|||||||
element.selectmenu();
|
element.selectmenu();
|
||||||
equal( element.selectmenu( "menuWidget" ).parent().parent()[ 0 ], $( "#selectmenu-wrap2" )[ 0 ], "null, inside .ui-front" );
|
equal( element.selectmenu( "menuWidget" ).parent().parent()[ 0 ], $( "#selectmenu-wrap2" )[ 0 ], "null, inside .ui-front" );
|
||||||
element.selectmenu( "destroy" );
|
element.selectmenu( "destroy" );
|
||||||
|
|
||||||
|
element.selectmenu({
|
||||||
|
appendTo: $()
|
||||||
|
});
|
||||||
|
equal( element.selectmenu( "menuWidget" ).parent().parent()[ 0 ], $( "#selectmenu-wrap2" )[ 0 ], "empty jQuery object, inside .ui-front" );
|
||||||
$( "#selectmenu-wrap2" ).removeClass( "ui-front" );
|
$( "#selectmenu-wrap2" ).removeClass( "ui-front" );
|
||||||
|
|
||||||
element.selectmenu().selectmenu( "option", "appendTo", "#selectmenu-wrap1" );
|
element.selectmenu().selectmenu( "option", "appendTo", "#selectmenu-wrap1" );
|
||||||
|
@ -474,7 +474,7 @@ return $.widget( "ui.selectmenu", {
|
|||||||
this.document.find( element ).eq( 0 );
|
this.document.find( element ).eq( 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !element ) {
|
if ( !element || !element[ 0 ] ) {
|
||||||
element = this.element.closest( ".ui-front" );
|
element = this.element.closest( ".ui-front" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user