Fixed dropdown for i18n input
authorAlexander Ebert <ebert@woltlab.com>
Tue, 15 May 2012 15:03:55 +0000 (17:03 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 15 May 2012 15:03:55 +0000 (17:03 +0200)
Fixes #567

wcfsetup/install/files/js/WCF.js

index b32510d197aa0a8cab8eb7017d9196067c9fe347..397115b117aa2e36b94576fb79d88d836a8288f8 100644 (file)
@@ -2167,7 +2167,9 @@ WCF.MultipleLanguageInput.prototype = {
                $button.data('toggle', $wrapper.wcfIdentify()).click($.proxy(this._enable, this));
                
                // add a special class if next item is a textarea
+               var $top = null;
                if ($button.next().getTagName() === 'textarea') {
+                       $top = $button.outerHeight() - 1;
                        $button.addClass('dropdownCaptionTextarea');
                }
                else {
@@ -2177,10 +2179,12 @@ WCF.MultipleLanguageInput.prototype = {
                // insert list
                this._list = $('<ul class="dropdownMenu"></ul>').insertAfter($button);
                
-               // calculate top offset for menu
-               this._list.css({
-                       top: $button.parent().outerHeight() + 10
-               });
+               // set top offset for menu
+               if ($top !== null) {
+                       this._list.css({
+                               top: $top
+                       });
+               }
                
                // insert available languages
                for (var $languageID in this._availableLanguages) {