Zurb Foundation 4 closed modal gets stuck

旧巷老猫 提交于 2019-11-27 08:46:48

问题


I have a modal popup which contains a View Details button that opens a different modal popup. I'm using $('#modalName').foundation('reveal', 'close') everywhere and it works very well. But in this case, I believe there is an event issue going on, because the modal closes but control never returns to the window.

This is the modal I want to close:

Notice the red box around the Done button and the X (close). I want the same code to execute no matter which way the user closes the popup.

CSHTML

@*The Modal View for Displaying Meter Tag Details*@
<div id="meterTagDetailsModal" class="reveal-modal medium">
    <div class="row modalTitleRow">
        <div class="small-12 columns">
            <h3>
                Meter Tags Details
            </h3>
        </div>
    </div>
    <br />

    <div class="row meterRow">
        <div class="small-12 columns">
            <table id="meterTagDetailsTable" class="meterTable">
                <thead>
                    <tr>
                        <th>Meter Name</th>
                        <th>Commodity</th>
                        <th>Building Name</th>
                        <th>Site</th>
                    </tr>
                </thead>
                <tbody></tbody>
            </table>

        </div>
        <a id="closeModal" class="close-reveal-modal">&#215;</a>
    </div>

    <div class="row meterRow">
        <div class="small-12 columns text-right">
            <a class="button tiny" onclick="$('#closeModal').click()">Done</a>
        </div>
    </div>
</div>

JavaScript

Bind event

$('#meterTagDetailsModal').on("closed", onCloseMeterTagDetails);

Method

onCloseMeterTagDetails = function () {
    $('#meterTagDetailsModal').foundation('reveal', 'close');
    $('#meterTagDetailsModal').trigger('reveal: close');
}

Execution gets into this method when the popup closes. But the view is stuck in limbo. I've tried both of the statements shown.

Does anybody know how I can get the view to close and return control to the window?

来源:https://stackoverflow.com/questions/49161370/zurb-foundation-4-closed-modal-gets-stuck

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