jQuery UI 1.10对话框-防止insertBefore [英] jQuery UI 1.10 dialog - prevent insertBefore

查看:85
本文介绍了jQuery UI 1.10对话框-防止insertBefore的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用新的jQuery UI,当打开两个对话框窗口并触发焦点时-获得焦点的对话框将在其他对话框之前插入.

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

我已经使用z-index进行了自己的操作,因此我想禁用默认设置.

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

我已设置 http://jsfiddle.net/2C7yG/以便您查看我的问题. 在这里,当我在对话框中放置iframe时,重新插入后-iframe得以重建.

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

我发现 http://jqueryui.com/upgrade-指南/1.10/#re​​moved-stack-option

我找到了,但是票无法打开

I found this but the ticket wont open

好吧,我找到了触发它的地方.

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;
    },

这是一个执行脚本.现在,我知道可以在jQuery中修改函数了.如何用我自己的功能扩展此部分?

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?

推荐答案

这是我添加到脚本中以禁用此行为的内容.

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

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

这篇关于jQuery UI 1.10对话框-防止insertBefore的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆