var data = [ "c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl" ];
test( "appendTo", function() {
- expect( 7 );
+ expect( 8 );
var detached = $( "<div>" ),
element = $( "#autocomplete" ).autocomplete();
equal( element.autocomplete( "widget" ).parent()[0], document.body, "defaults to body" );
});
equal( element.autocomplete( "widget" ).parent()[0], detached[0], "detached DOM element" );
element.autocomplete( "destroy" );
+
+ element.autocomplete().autocomplete( "option", "appendTo", detached );
+ equal( element.autocomplete( "widget" ).parent()[0], detached[0], "detached DOM element via option()" );
+ element.autocomplete( "destroy" );
});
function autoFocusTest( afValue, focusedLength ) {
this._initSource();
}
if ( key === "appendTo" ) {
- this.menu.element.appendTo( this.document.find( value || "body" )[0] );
+ this.menu.element.appendTo( this._appendTo() );
}
if ( key === "disabled" && value && this.xhr ) {
this.xhr.abort();