From f50ba15111a22b3de7a4261ee20998b138978f11 Mon Sep 17 00:00:00 2001 From: Argo-MacBookPro Date: Fri, 3 Aug 2018 21:19:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9BUG=EF=BC=9A=E6=9B=B4?= =?UTF-8?q?=E6=96=B0modal=E5=B5=8C=E5=A5=97bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Bootstrap.Admin/wwwroot/js/Menus.js | 30 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Bootstrap.Admin/wwwroot/js/Menus.js b/Bootstrap.Admin/wwwroot/js/Menus.js index 650d21c6..9fe75c20 100644 --- a/Bootstrap.Admin/wwwroot/js/Menus.js +++ b/Bootstrap.Admin/wwwroot/js/Menus.js @@ -21,6 +21,8 @@ $nestMenuInput.children('.checkbox').hide(); } + var state = []; + var bsa = new BootstrapAdmin({ url: Menu.url, dataEntity: new DataEntity({ @@ -177,8 +179,7 @@ $nestMenu.find('ol.dd-list:first').append($.format('
  • ', menuName, menuCate)); } $nestMenu.find('li[data-id="' + did + '"] > div.dd3-content span').addClass('active'); - $dialogNew.hide(); - $dialogMenu.modal('show'); + showDialog(); }); // 选择父节点按钮 @@ -187,11 +188,21 @@ $nestMenuInput.find('label:last').find('input').show(); $nestMenu.find('li.dd-item').hide().remove('[data-id="0"]'); $nestMenu.find('li[data-category="' + $category.val() + '"]').show(); - $dialogNew.hide(); - $dialogMenu.modal('show'); + showDialog(); }); - $dialogMenu.on('hidden.bs.modal', function () { $dialogNew.show(); }); + function showDialog() { + state.push({ css: $('body').attr("class"), style: $('body').attr("style") }); + $dialogNew.hide(); + $dialogMenu.modal('show'); + }; + + $dialogMenu.on('hidden.bs.modal', function () { + var sta = state.pop(); + $('body').attr('class', sta.css); + $('body').attr('style', sta.style); + $dialogNew.show(); + }); $btnSubmitMenu.on('click', function () { $nestMenu.find('li span').removeClass('active'); @@ -245,13 +256,4 @@ } } }); - - $(window).on('resize.bs.modal', function () { - if ($dialogMenu.is(':visible') && ($(window).width() >= 768 || $(window).height() >= 672)) { - $dialogMenu.adjustDialog(); - } - else { - $dialogMenu.css({ margin: "0" }); - } - }); }); \ No newline at end of file