From 46b44739e88a558f27159c1896e9ee92a8fc5ba0 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 10 Feb 2012 15:26:57 +0100 Subject: [PATCH] i18n input is now properly forced upon request Fixes #422 --- wcfsetup/install/files/js/WCF.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index b381ef1d18..8e13577f13 100644 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1836,7 +1836,7 @@ WCF.MultipleLanguageInput.prototype = { $button.click($.proxy(this._enable, this)); WCF.CloseOverlayHandler.addCallback(this._element.wcfIdentify(), $.proxy(this._closeSelection, this)); - if (enableOnInit) { + if (enableOnInit || this._forceSelection) { $button.trigger('click'); // pre-select current language @@ -1877,7 +1877,9 @@ WCF.MultipleLanguageInput.prototype = { } // disable language input - $('
  • disable i18n
  • ').click($.proxy(this._disable, this)).appendTo(this._list); + if (!this._forceSelection) { + $('
  • disable i18n
  • ').click($.proxy(this._disable, this)).appendTo(this._list); + } } this._isEnabled = true; @@ -1967,6 +1969,10 @@ WCF.MultipleLanguageInput.prototype = { * Disables language selection for current element. */ _disable: function() { + if (this._forceSelection) { + return; + } + // remove active marking this._list.prev('.wcf-dropdownCaption').children('span').removeClass('active').text('enable i18n'); this._closeSelection(); -- 2.20.1