Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#10116 closed bug (duplicate)

Dialog: moveToTop implementation resets flash/video/iframe/scroll when switch between dialogs

Reported by: Frank Owned by:
Priority: minor Milestone: none
Component: ui.dialog Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:

Description

When multiple dialogs are open, each containing a flash or video element, and the dialogs are selected so that the other loses focus, UI code moves the newly selected dialog to the top by inserting all other sibling dialogs before the selected dialog. This causes the flash content of the deselected dialog to be reset as it is detached from DOM. The examples can be seen below:

-> with JqueryUI v1.10.3/1.10.4 and Jquery core 1.11.1 and previous -> browser Chrome/Safari/Firefox/IE

Test in : http://jsfiddle.net/zBdGQ/

Change History (5)

comment:1 Changed 9 years ago by Frank

Currently I have used this workaround by overriding the method _moveToTop :

$.ui.dialog.prototype._moveToTop = function (event, silent) {

var zIndexDefault = 100; var $elementsOnSameLevel = $(window.parent.document).find('.ui-dialog:visible'); var heighestZIndex = zIndexDefault;

$.each($elementsOnSameLevel, function(index, element) {

var zIndexOfElement = $(element).css('z-index'); if (zIndexOfElement) {

var zIndexOfElementAsNumber = parseInt(zIndexOfElement,10)
0;

if (zIndexOfElementAsNumber > heighestZIndex) {

heighestZIndex = zIndexOfElementAsNumber;

}

}

}); var currentZIndex = parseInt(this.uiDialog.css('z-index'),10);

var moved; if (currentZIndex > heighestZIndex) {

moved = false;

} else {

this.uiDialog.css('z-index', heighestZIndex + 1); moved = true;

}

if ( moved && !silent ) {

this._trigger( "focus", event );

}

return moved;

};

comment:2 Changed 9 years ago by tj.vantoll

Resolution: duplicate
Status: newclosed

Duplicate of #9166.

comment:3 Changed 9 years ago by Frank

Sorry but the ticket is to be fixed while the error is still there. Why?

Thanks for your work

comment:4 in reply to:  3 Changed 9 years ago by tj.vantoll

Replying to Frank:

Sorry but the ticket is to be fixed while the error is still there. Why?

Thanks for your work

It is fixed in 1.11, which should be out next week. Here's your example working with 1.11: http://jsfiddle.net/tj_vantoll/qmN7J/.

comment:5 Changed 9 years ago by Frank

Ok Ok ... very very good ..

Thanks

Note: See TracTickets for help on using tickets.