[BUGFIX] Restore expand state of module groups 65/36665/3
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Thu, 5 Feb 2015 08:18:42 +0000 (09:18 +0100)
committerBenjamin Mack <benni@typo3.org>
Thu, 5 Feb 2015 09:56:51 +0000 (10:56 +0100)
This patch recovers the expand state of module groups when they
were collapsed before.

Resolves: #64859
Releases: master
Change-Id: Id4b527d287a8ca1a7dd542639d4c5a691fe0f065
Reviewed-on: http://review.typo3.org/36665
Reviewed-by: Göran Bodenschatz <coding@46halbe.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
typo3/sysext/backend/Resources/Public/JavaScript/modulemenu.js

index dd696a8..c382b3c 100644 (file)
@@ -43,6 +43,9 @@ TYPO3.ModuleMenu.App = {
                require(['TYPO3/CMS/Backend/Storage'], function() {
                        var collapsedMainMenuItems = me.getCollapsedMainMenuItems();
                        TYPO3.jQuery.each(collapsedMainMenuItems, function(key, itm) {
+                               if (itm !== true) {
+                                       return;
+                               }
                                var $group = TYPO3.jQuery('#' + key);
                                if ($group.length > 0) {
                                        var $groupContainer = $group.find('.typo3-module-menu-group-container');
@@ -246,7 +249,7 @@ TYPO3.ModuleMenu.App = {
         */
        removeCollapseMainMenuItem: function(item) {
                var existingItems = this.getCollapsedMainMenuItems();
-               existingItems[item] = null;
+               delete existingItems[item];
                TYPO3.Storage.Persistent.set('modulemenu', JSON.stringify(existingItems));
        }