[BUGFIX] Ensure module menu is correctly closed after click on overlay 99/52199/4
authorBenjamin Kott <benjamin.kott@wfp2.com>
Mon, 27 Mar 2017 20:55:30 +0000 (22:55 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Tue, 28 Mar 2017 10:32:00 +0000 (12:32 +0200)
Resolves: #80502
Releases: master
Change-Id: I01cac3870381c1783e0a1bb1226c0ab537619455
Reviewed-on: https://review.typo3.org/52199
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/backend/Resources/Public/JavaScript/ModuleMenu.js

index 5da493b..a8ebed5 100644 (file)
@@ -121,6 +121,9 @@ require(
                                );
 
                        },
+                       /**
+                        * @param {bool} collapse
+                        */
                        toggleMenu: function (collapse) {
                                TYPO3.Backend.NavigationContainer.cleanup();
 
@@ -128,14 +131,13 @@ require(
                                var expandedClass = 'scaffold-modulemenu-expanded';
 
                                if (typeof collapse === 'undefined') {
-                                       collapse = $mainContainer.hasClass(expandedClass) ? 'true' : '';
+                                       collapse = $mainContainer.hasClass(expandedClass);
                                }
-                               if (collapse === 'true') {
-                                       $mainContainer.removeClass(expandedClass);
-                               } else {
-                                       $mainContainer.addClass(expandedClass);
-                                       $('.scaffold').removeClass('scaffold-search-expanded');
-                                       $('.scaffold').removeClass('scaffold-toolbar-expanded');
+                               $mainContainer.toggleClass(expandedClass, !collapse);
+                               if (!collapse) {
+                                       $('.scaffold')
+                                               .removeClass('scaffold-search-expanded')
+                                               .removeClass('scaffold-toolbar-expanded');
                                }
 
                                // Persist collapsed state in the UC of the current user