Xpages:从模态对话框中打开模态

时间:2015-07-01 10:41:15

标签: xpages xpages-extlib

我想复制与Modal对话框相同的功能。打开模态对话框后,它会窗帘(锁定)父窗口。现在,如果我有一个按钮在另一个模态窗口中打开文档,它不会窗帘父模态窗口(原始窗口仍然是窗帘)。enter image description here

2 个答案:

答案 0 :(得分:0)

正如Oliver Busse在评论中指出的那样,Bootstrap 3没有正式支持这一点。来自their documentation on modals

multiple open modals not supported

如果您仍然打算实现这一目标,那么您创建的任何解决方案都将依赖于自定义代码(而不是您当前正在使用的Bootstrap主题)。作为一个概念证明,我建议你阅读this article,它实现了我相信你一直在寻找的东西。无论何时单击后续模式按钮,主要功能似乎在于触发其他CSS类来模拟背景效果。

以下是链接文章中the demo的来源。以下是摘录的JavaScript,它将fv-modal-stack的类应用于基础模态,并相应地增加z-index。

$(document).ready(function () {
    $('#openBtn').click(function () {
        $('#myModal').modal({
            show: true
        })
    });

    $('.modal').on('hidden.bs.modal', function (event) {
        $(this).removeClass('fv-modal-stack');
        $('body').data('fv_open_modals', $('body').data('fv_open_modals') - 1);
    });

    $('.modal').on('shown.bs.modal', function (event) {
        // keep track of the number of open modals
        if (typeof ($('body').data('fv_open_modals')) == 'undefined') {
            $('body').data('fv_open_modals', 0);
        }

        // if the z-index of this modal has been set, ignore.
        if ($(this).hasClass('fv-modal-stack')) {
            return;
        }
        $(this).addClass('fv-modal-stack');
        $('body').data('fv_open_modals', $('body').data('fv_open_modals') + 1);
        $(this).css('z-index', 1040 + (10 * $('body').data('fv_open_modals')));
        $('.modal-backdrop').not('.fv-modal-stack')
            .css('z-index', 1039 + (10 * $('body').data('fv_open_modals')));
        $('.modal-backdrop').not('fv-modal-stack')
            .addClass('fv-modal-stack');
    });
});

答案 1 :(得分:0)

这是来自Johnny Oldenburger的另一个article

我不知道这是对的。但要表明。