Adds CSS class which indicates if container is collased
authorMatthias Schmidt <gravatronics@live.com>
Sat, 12 Jan 2013 12:16:40 +0000 (13:16 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 12 Jan 2013 12:16:40 +0000 (13:16 +0100)
wcfsetup/install/files/js/WCF.js

index a8cf99063a1376329cf55553bf5cc6d569ee2b9d..b80df169b3cc68713636f06a2e5dee389e54928c 100755 (executable)
@@ -3489,6 +3489,11 @@ WCF.Collapsible.Remote = Class.extend({
                        isOpen: this._containers[containerID].data('isOpen'),
                        target: $target
                };
+               
+               // add 'jsCollapsed' CSS class
+               if (!this._containers[containerID].data('isOpen')) {
+                       $('#' + containerID).addClass('jsCollapsed');
+               }
        },
        
        /**
@@ -3554,6 +3559,9 @@ WCF.Collapsible.Remote = Class.extend({
                });
                this._proxy.sendRequest();
                
+               // toogle 'jsCollapsed' CSS class
+               $('#' + $containerID).toggleClass('jsCollapsed');
+               
                // set spinner for current button
                this._exchangeIcon($button);
        },
@@ -3696,6 +3704,9 @@ WCF.Collapsible.SimpleRemote = WCF.Collapsible.Remote.extend({
                        this._containerData[$containerID].target.hide();
                }
                
+               // toogle 'jsCollapsed' CSS class
+               $('#' + $containerID).toggleClass('jsCollapsed');
+               
                // update container data
                this._containerData[$containerID].isOpen = ($newState === 'open' ? true : false);
        }