diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2013-09-27 18:53:15 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2013-10-02 17:02:28 +0200 |
commit | e263ebda99f3d414bae91a4a47e74a37ff93ba9c (patch) | |
tree | d69d4f892181ba5db1e3fdcbb2d7cb4dae9e4f6b /ui | |
parent | 80b17bb40a1a0956e954d41550ebdf69ee480ae2 (diff) | |
download | jquery-ui-e263ebda99f3d414bae91a4a47e74a37ff93ba9c.tar.gz jquery-ui-e263ebda99f3d414bae91a4a47e74a37ff93ba9c.zip |
Dialog: Switch back to shuffling z-index, but only look at .ui-front siblings.
Fixes #9166 - Dialog: moveToTop implementation resets flash/video/iframe/scroll
Fixes #9364 - Dialog: Click of element with tooltip scrolls the dialog to the top
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.dialog.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index f7265e605..0669cd852 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -212,7 +212,17 @@ $.widget( "ui.dialog", { }, _moveToTop: function( event, silent ) { - var moved = !!this.uiDialog.nextAll(":visible").insertBefore( this.uiDialog ).length; + var moved = false, + zIndicies = this.uiDialog.siblings( ".ui-front:visible" ).map(function() { + return +$( this ).css( "z-index" ); + }).get(), + zIndexMax = Math.max.apply( null, zIndicies ); + + if ( zIndexMax >= +this.uiDialog.css( "z-index" ) ) { + this.uiDialog.css( "z-index", zIndexMax + 1 ); + moved = true; + } + if ( moved && !silent ) { this._trigger( "focus", event ); } |