From fd40e841cb89bf9591fea06b1d396d444102243c Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 24 Jul 2012 17:09:26 +0200 Subject: [PATCH] [ticket/11004] Always update suggestion button in timezone_preselect_select Suggestion must also be updated when the suggestion is selected at first, so we can display a correct button, when the suggestion is not selected anymore. PHPBB3-11004 --- phpBB/assets/javascript/core.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js index 669f662b16..17e859eedc 100644 --- a/phpBB/assets/javascript/core.js +++ b/phpBB/assets/javascript/core.js @@ -499,18 +499,20 @@ phpbb.timezone_preselect_select = function(force_selector) { if ($('#tz_date').val() != option.value && !force_selector) { // We do not select the option for the user, but notify him, // that we would suggest a different setting. - $('#tz_select_date_suggest').css('display', 'inline'); - $('#tz_select_date_suggest').attr('title', $('#tz_select_date_suggest').attr('data-l-suggestion').replace("%s", option.innerHTML)); - $('#tz_select_date_suggest').attr('value', $('#tz_select_date_suggest').attr('data-l-suggestion').replace("%s", option.innerHTML.substring(0, 9))); - $('#tz_select_date_suggest').attr('data-suggested-tz', option.innerHTML); phpbb.timezone_switch_date(true); + $('#tz_select_date_suggest').css('display', 'inline'); } else { option.selected = true; phpbb.timezone_switch_date(!force_selector); - $('#tz_select_date_suggest').attr('data-suggested-tz', option.innerHTML); $('#tz_select_date_suggest').css('display', 'none'); } - break; + + $('#tz_select_date_suggest').attr('title', $('#tz_select_date_suggest').attr('data-l-suggestion').replace("%s", option.innerHTML)); + $('#tz_select_date_suggest').attr('value', $('#tz_select_date_suggest').attr('data-l-suggestion').replace("%s", option.innerHTML.substring(0, 9))); + $('#tz_select_date_suggest').attr('data-suggested-tz', option.innerHTML); + + // Found the suggestion, there cannot be more, so return from here. + return; } } }