mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
Fix modals dependency cycle.
This commit forces the files that create modals to create their own modal closing function instead of creating all of them in the modals file. These functions are then passed to the modals.close object. This is intended to remove modals.js's dependencies on these other files.
This commit is contained in:
@@ -376,6 +376,12 @@ exports.launch = function () {
|
||||
};
|
||||
|
||||
$(function () {
|
||||
|
||||
function drafts_close_modal() {
|
||||
hashchange.exit_modal();
|
||||
}
|
||||
modals.set_close_handler("drafts", drafts_close_modal);
|
||||
|
||||
window.addEventListener("beforeunload", function () {
|
||||
exports.update_draft();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user