I have a modal popup containing a View Details button that opens another modal popup. I use $('#modalName').foundation('reveal', 'close') everywhere and it works very well. But in this case, I believe that there is a problem with the event, because the modal closes, but the control never returns to the window.

This is the modal that I want to close:

Notice the red frame around the Finish button and the X (close) button. I want the same code to be executed no matter how 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">×</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
Binding Event
$('#meterTagDetailsModal').on("closed", onCloseMeterTagDetails);
Method
onCloseMeterTagDetails = function () { $('#meterTagDetailsModal').foundation('reveal', 'close'); $('#meterTagDetailsModal').trigger('reveal: close'); }
Execution gets this method when the popup closes. But his gaze was stuck in limbo. I tried both readings.
Does anyone know how I can get a view to close and return control to a window?
javascript zurb-foundation
Patricia
source share