From 54a01b495bae40b555093c897e8aad37959df0c9 Mon Sep 17 00:00:00 2001 From: shanshuirenjia Date: Wed, 8 Aug 2018 16:53:26 +0800 Subject: [PATCH] repair the mobile menu's bug (#2268) --- seahub/templates/view_file_base.html | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/seahub/templates/view_file_base.html b/seahub/templates/view_file_base.html index 7c8bc25dc2..db86001b41 100644 --- a/seahub/templates/view_file_base.html +++ b/seahub/templates/view_file_base.html @@ -601,7 +601,12 @@ var DropDownMenu = { //if mobile : bind the popmenu event if ($(".sf2-mobile-menu-toggle").length) { $(".sf2-mobile-menu-toggle").on('click',function(){ - _this.clickToShowPopMenu(); + var isDisplay = $('.sf2-mobile-menu').css('display') === "block" ? true : false; + if (isDisplay) { + _this.clickToClosePopMenu(); + } else { + _this.clickToShowPopMenu(); + } return false; }) $(document).on('click', function(e){ @@ -667,12 +672,10 @@ var DropDownMenu = { }, clickToClosePopMenu: function() { - $(".sf2-mobile-menu-mask").hide(); $(".sf2-mobile-menu").hide(); }, clickToShowPopMenu: function() { - $(".sf2-mobile-menu-mask").show(); $(".sf2-mobile-menu").show(); } }