Skip to content

Include native dialog in appendTo/ui-front logic #1517

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ui/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ $.widget( "ui.autocomplete", {
}

if ( !element || !element[ 0 ] ) {
element = this.element.closest( ".ui-front" );
element = this.element.closest( ".ui-front,dialog" );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is there no space after the comma?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a habit that creeps in every once in a while. I blame John for always using no spaces in selectors since they can't be munged by minification tools. Off the top of my head, I was able to think of two places we have selectors with commas and one has spaces and one doesn't :-P

I can add the spaces in; I actually prefer it that way.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer the space, too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a search and found all the selectors that weren't using spaces. Here's a PR: #1521

}

if ( !element.length ) {
Expand Down
2 changes: 1 addition & 1 deletion ui/selectmenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ return $.widget( "ui.selectmenu", {
}

if ( !element || !element[ 0 ] ) {
element = this.element.closest( ".ui-front" );
element = this.element.closest( ".ui-front,dialog" );
}

if ( !element.length ) {
Expand Down
12 changes: 11 additions & 1 deletion ui/tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ $.widget( "ui.tooltip", {
this._addClass( content, "ui-tooltip-content" );
this._addClass( tooltip, "ui-tooltip", "ui-widget ui-widget-content" );

tooltip.appendTo( this.document[ 0 ].body );
tooltip.appendTo( this._appendTo( element ) );

return this.tooltips[ id ] = {
element: element,
Expand All @@ -446,6 +446,16 @@ $.widget( "ui.tooltip", {
delete this.tooltips[ tooltip.attr( "id" ) ];
},

_appendTo: function( target ) {
var element = target.closest( ".ui-front,dialog" );

if ( !element.length ) {
element = this.document[ 0 ].body;
}

return element;
},

_destroy: function() {
var that = this;

Expand Down