Triggering 'resize' event once sidebar collapsed/expanded
authorAlexander Ebert <ebert@woltlab.com>
Fri, 6 Sep 2013 17:19:46 +0000 (19:19 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 6 Sep 2013 17:19:46 +0000 (19:19 +0200)
wcfsetup/install/files/js/WCF.js

index 9487212976c1eaa7252e7aa8c223eb882d6f7620..e93bb8f3e3177b221e0aa1d2fc7bad5f74a071f3 100755 (executable)
@@ -4631,6 +4631,10 @@ WCF.Collapsible.Sidebar = Class.extend({
                
                this._renderSidebar();
                this._scroll();
+               
+               // fake resize event once transition has completed
+               var $window = $(window);
+               this._sidebar.on('webkitTransitionEnd transitionend msTransitionEnd oTransitionEnd', function() { $window.trigger('resize'); });
        },
        
        /**
@@ -4702,6 +4706,11 @@ WCF.Collapsible.Sidebar = Class.extend({
                
                // update button position
                this._scroll();
+               
+               // IE9 does not support transitions, fire resize event manually
+               if ($.browser.msie && $.browser.version.indexOf('9') === 0) {
+                       $(window).trigger('resize');
+               }
        }
 });