From: Alexander Ebert Date: Tue, 13 Nov 2012 16:42:27 +0000 (+0100) Subject: Added option to use WCF.Language.Chooser as language filter X-Git-Tag: 2.0.0_Beta_1~781^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=65b1d6a04d6e0f2cda616cca5bc245b512d11f4d;p=GitHub%2FWoltLab%2FWCF.git Added option to use WCF.Language.Chooser as language filter --- diff --git a/com.woltlab.wcf/template/headInclude.tpl b/com.woltlab.wcf/template/headInclude.tpl index 9e8c0bfad9..0a23ee5d12 100644 --- a/com.woltlab.wcf/template/headInclude.tpl +++ b/com.woltlab.wcf/template/headInclude.tpl @@ -38,6 +38,11 @@ //').appendTo($dropdownMenu); + var $item = $('
  • ' + WCF.Language.get('wcf.global.language.noSelection') + '
  • ').data('languageID', 0).click($.proxy(this._click, this)).appendTo($dropdownMenu); + + if (languageID === 0) { + this._dropdown.children('.dropdownToggle').empty().append($item.html()); + } + } + WCF.Dropdown.init(); }, @@ -6887,13 +6898,14 @@ WCF.Language.Chooser = Class.extend({ */ _click: function(event) { var $item = $(event.currentTarget); + var $languageID = $item.data('languageID'); // update input field - this._input.val($item.data('languageID')); + this._input.val($languageID); // update dropdown label var $html = $('' + $item.html()); - var $innerContent = $html.children().detach(); + var $innerContent = ($languageID === 0) ? $html : $html.children().detach(); this._dropdown.children('.dropdownToggle').empty().append($innerContent); // execute callback diff --git a/wcfsetup/install/lang/de.xml b/wcfsetup/install/lang/de.xml index a2ea62a049..631bc6382f 100644 --- a/wcfsetup/install/lang/de.xml +++ b/wcfsetup/install/lang/de.xml @@ -703,6 +703,7 @@ +