diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-01-17 13:19:46 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-01-17 13:19:46 +0100 |
commit | 304de6409a023dfff8591c096b30a44dddb60b39 (patch) | |
tree | dc0b5e05142a16d0824033abf957bef8740c7dd3 /ishtar_common/static/js/ishtar.js | |
parent | 57d10099ff48f51a9e24a61ec06f30178f1330ec (diff) | |
download | Ishtar-304de6409a023dfff8591c096b30a44dddb60b39.tar.bz2 Ishtar-304de6409a023dfff8591c096b30a44dddb60b39.zip |
JS: fix modal scroll on child modal close
Diffstat (limited to 'ishtar_common/static/js/ishtar.js')
-rw-r--r-- | ishtar_common/static/js/ishtar.js | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/ishtar_common/static/js/ishtar.js b/ishtar_common/static/js/ishtar.js index 8794fc722..00a9b66a0 100644 --- a/ishtar_common/static/js/ishtar.js +++ b/ishtar_common/static/js/ishtar.js @@ -38,6 +38,7 @@ function get_previous_table_id(){} var shortcut_url = ''; var datatables_i18n; +var current_modal; var datatables_default = { "processing": true, @@ -59,7 +60,7 @@ var shortcut_menu_hide_url = '/hide-shortcut-menu/' var shortcut_menu_show_url = '/show-shortcut-menu/' function init_shortcut_menu(html){ - $('.modal-progress').modal('hide'); + close_wait(); $("#context-menu").html(html); $(".chosen-select").chosen(); if (advanced_menu) { @@ -194,7 +195,7 @@ function load_shortcut_menu(){ init_shortcut_menu(html); }, error:function(XMLHttpRequest, textStatus, errorThrows){ - $('.modal-progress').modal('hide'); + close_wait(); } }); } @@ -272,6 +273,13 @@ function long_wait(){ }, 240000); } +function close_wait(){ + $('.modal-progress').modal('hide'); + if (current_modal){ + $('body').addClass('modal-open'); + } +} + var last_window; function load_window(url, speed, on_success, no_jump){ @@ -280,7 +288,7 @@ function load_window(url, speed, on_success, no_jump){ url: url, cache: false, success:function(html){ - $('.modal-progress').modal('hide'); + close_wait(); $(".previous_page").remove(); $(".next_page").remove(); var register_id = $(html).find(".card-header").attr("data-sheet-id"); @@ -301,7 +309,7 @@ function load_window(url, speed, on_success, no_jump){ if (on_success) on_success(); }, error:function(XMLHttpRequest, textStatus, errorThrows){ - $('.modal-progress').modal('hide'); + close_wait(); } }); } @@ -326,10 +334,10 @@ function load_url(url){ url: url, cache: false, success:function(html){ - $('.modal-progress').modal('hide'); + close_wait(); }, error:function(XMLHttpRequest, textStatus, errorThrows){ - $('.modal-progress').modal('hide'); + close_wait(); } }); } |