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

Xpages: Open Modal from within Modal Dialogs

我想复制与模态对话框相同的功能。打开模态对话框后,它会隐藏(锁定)父项 window。现在,如果我有一些按钮可以在另一个模式 window 中打开文档,它不会关闭父模式 window(原始 window 仍然关闭)。

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

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

这是链接文章中 the demo 的来源。这是摘录的 JavaScript,它将 fv-modal-stack 的 class 应用于基础模态,并相应地增加 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');
    });
});

这是来自 Johnny Oldenburger 的另一个 article

我不知道这是正确的。但是显示出来。