Fixes drop down menu position after window resize
authorMatthias Schmidt <gravatronics@live.com>
Wed, 10 Jul 2013 15:50:41 +0000 (17:50 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Wed, 10 Jul 2013 15:50:41 +0000 (17:50 +0200)
Fixes #1403

wcfsetup/install/files/js/WCF.js

index de6ff699aaadb1eb0040245a36629935ac7e3610..ae6f3c0ba85cade74273f927a273be879d97748e 100755 (executable)
@@ -715,6 +715,18 @@ WCF.Dropdown = {
                        WCF.CloseOverlayHandler.addCallback('WCF.Dropdown', $.proxy(this._closeAll, this));
                        WCF.DOMNodeInsertedHandler.addCallback('WCF.Dropdown', $.proxy(this.init, this));
                }
+               
+               $(window).resize($.proxy(this._resize, this));
+       },
+       
+       /**
+        * Handles resizing the window by making sure that the menu positions are
+        * recalculated.
+        */
+       _resize: function() {
+               for (var $containerID in this._dropdowns) {
+                       this._menus[$containerID].removeData('orientationX');
+               }
        },
        
        /**
@@ -4697,7 +4709,7 @@ WCF.Effect.BalloonTooltip = Class.extend({
         */
        init: function() {
                if (jQuery.browser.mobile) return;
-
+               
                if (!this._didInit) {
                        // create empty div
                        this._tooltip = $('<div id="balloonTooltip" class="balloonTooltip"><span id="balloonTooltipText"></span><span class="pointer"><span></span></span></div>').appendTo($('body')).hide();