From 435797a54e4d322a46711f303c2fc1fd5286330e Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 10 Oct 2024 13:42:18 +0200 Subject: ✨ site and operation relations forms refactoring MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/static/js/ishtar.js | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'ishtar_common/static/js/ishtar.js') diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js index 2bcfe5a7e..1ef2e4c1d 100644 --- a/ishtar_common/static/js/ishtar.js +++ b/ishtar_common/static/js/ishtar.js @@ -454,8 +454,29 @@ $(document).ready(function(){ $("[aria-controls='" + $(this).attr("id") + "']").click(); } }); + register_modal_on_close(); }); + +var modal_on_close = new Array(); + +var register_modal_on_close = function(){ + $(".modal").each( + function(){ + if (this.id) { + modal_on_close[this.id] = undefined; + $("#" + this.id).on('hide.bs.modal', function() { + if (modal_on_close[this.id] !== undefined){ + modal_on_close[this.id](); + // reinitialize after call + modal_on_close[this.id] = undefined; + } + }); + } + } + ); +} + var register_wait_button = function(){ $(".wait-button").click(function(){short_wait()}); }; -- cgit v1.2.3