From 65b1d6a04d6e0f2cda616cca5bc245b512d11f4d Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 13 Nov 2012 17:42:27 +0100 Subject: [PATCH] Added option to use WCF.Language.Chooser as language filter --- com.woltlab.wcf/template/headInclude.tpl | 25 ++++++++++++------------ wcfsetup/install/files/js/WCF.js | 18 ++++++++++++++--- wcfsetup/install/lang/de.xml | 1 + 3 files changed, 29 insertions(+), 15 deletions(-) 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 @@ + -- 2.20.1