jQuery UI 1.10 dialog - prevent insertBefore

眉间皱痕 提交于 2019-12-12 01:09:23

问题


With new jQuery UI, when opening two dialog windows and triggering focus - the dialog which gets focus will be inserted before other dialogs.

I have made my own way of doing this with z-index, so I want to disable default one.

I have set up http://jsfiddle.net/2C7yG/ for you to see my problem. Here when I have iframe inside dialog, after reinserting - iframe gets reconstructed.

So it there any way to disable this behaviour?

I also want to link this issue which I think describes the same


Edit: I found http://jqueryui.com/upgrade-guide/1.10/#removed-stack-option

I found this but the ticket wont open


EDIT: Okay I found place which triggers this.

_moveToTop: function( event, silent ) {
        var moved = !!this.uiDialog.nextAll(":visible").insertBefore( this.uiDialog ).length;
        if ( moved && !silent ) {
            this._trigger( "focus", event );
        }
        return moved;
    },

This is a script which gets executed. Now I know that I can modify functions inside jQuery. how to extend this part with my own functionality?


回答1:


This is what I added to my scripts to disable this behaviour.

jQuery.ui.dialog.prototype._moveToTop = function(event, silent) {
    return true;
};


来源:https://stackoverflow.com/questions/21826296/jquery-ui-1-10-dialog-prevent-insertbefore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!