Skip to main content

Search and Top Navigation

#10116 closed bug (duplicate)

Opened June 18, 2014 11:04AM UTC

Closed June 18, 2014 01:12PM UTC

Last modified June 19, 2014 06:05PM UTC

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/

Attachments (0)
Change History (5)

Changed June 18, 2014 11:06AM UTC by Frank comment:1

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;

};

Changed June 18, 2014 01:12PM UTC by tj.vantoll comment:2

resolution: → duplicate
status: newclosed

Duplicate of #9166.

Changed June 18, 2014 06:57PM UTC by Frank comment:3

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

Thanks for your work

Changed June 18, 2014 07:06PM UTC by tj.vantoll comment:4

Replying to [comment:3 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/.

Changed June 19, 2014 06:05PM UTC by Frank comment:5

Ok Ok ... very very good ..

Thanks