aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/assets/javascript/core.js29
-rw-r--r--phpBB/styles/prosilver/template/timezone_option.html2
-rw-r--r--phpBB/styles/subsilver2/template/timezone_option.html2
3 files changed, 23 insertions, 10 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index c40852388e..17e859eedc 100644
--- a/phpBB/assets/javascript/core.js
+++ b/phpBB/assets/javascript/core.js
@@ -417,8 +417,19 @@ phpbb.ajaxify = function(options) {
* @param bool keep_selection Shall we keep the value selected, or shall the user be forced to repick one.
*/
phpbb.timezone_switch_date = function(keep_selection) {
- $('#timezone > optgroup').css('display', 'none');
- $("#timezone > optgroup[label='" + $('#tz_date').val() + "']").css('display', 'block');
+ if ($('#timezone_copy').length == 0) {
+ // We make a backup of the original dropdown, so we can remove optgroups
+ // instead of setting display to none, because IE and chrome will not
+ // hide options inside of optgroups and selects via css
+ $('#timezone').clone().attr('id', 'timezone_copy').css('display', 'none').attr('name', 'tz_copy').insertAfter('#timezone');
+ } else {
+ // Copy the content of our backup, so we can remove all unneeded options
+ $('#timezone').replaceWith($('#timezone_copy').clone().attr('id', 'timezone').css('display', 'block').attr('name', 'tz'));
+ }
+
+ if ($('#tz_date').val() != '') {
+ $('#timezone > optgroup').remove(":not([label='" + $('#tz_date').val() + "'])");
+ }
if ($('#tz_date').val() == $('#tz_select_date_suggest').attr('data-suggested-tz')) {
$('#tz_select_date_suggest').css('display', 'none');
@@ -488,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;
}
}
}
diff --git a/phpBB/styles/prosilver/template/timezone_option.html b/phpBB/styles/prosilver/template/timezone_option.html
index 94e2bbdfbd..24d6aa677f 100644
--- a/phpBB/styles/prosilver/template/timezone_option.html
+++ b/phpBB/styles/prosilver/template/timezone_option.html
@@ -6,7 +6,7 @@
<option value="">{L_SELECT_CURRENT_TIME}</option>
{S_TZ_DATE_OPTIONS}
</select>
- <input id="tz_select_date_suggest" class="inputbox button2" style="display: none; width: 150px !important;" data-is-registration="<!-- IF S_REGISTRATION -->true<!-- ELSE -->false<!-- ENDIF -->" data-l-suggestion="{L_TIMEZONE_DATE_SUGGESTION}" value="fuu" />
+ <input type="button" id="tz_select_date_suggest" class="button2" style="display: none;" data-is-registration="<!-- IF S_REGISTRATION -->true<!-- ELSE -->false<!-- ENDIF -->" data-l-suggestion="{L_TIMEZONE_DATE_SUGGESTION}" value="{L_TIMEZONE_DATE_SUGGESTION}" />
</dd>
<!-- ENDIF -->
<dd>
diff --git a/phpBB/styles/subsilver2/template/timezone_option.html b/phpBB/styles/subsilver2/template/timezone_option.html
index 3f1e14b33d..c7e47a8ee4 100644
--- a/phpBB/styles/subsilver2/template/timezone_option.html
+++ b/phpBB/styles/subsilver2/template/timezone_option.html
@@ -7,7 +7,7 @@
<option value="">{L_SELECT_CURRENT_TIME}</option>
{S_TZ_DATE_OPTIONS}
</select><br />
- <input id="tz_select_date_suggest" class="btnlite" style="display: none;" data-is-registration="<!-- IF S_REGISTRATION -->true<!-- ELSE -->false<!-- ENDIF -->" data-l-suggestion="{L_TIMEZONE_DATE_SUGGESTION}" value="{L_TIMEZONE_DATE_SUGGESTION}" />
+ <input type="button" id="tz_select_date_suggest" class="btnlite" style="display: none;" data-is-registration="<!-- IF S_REGISTRATION -->true<!-- ELSE -->false<!-- ENDIF -->" data-l-suggestion="{L_TIMEZONE_DATE_SUGGESTION}" value="{L_TIMEZONE_DATE_SUGGESTION}" />
</div>
<!-- ENDIF -->
<select name="tz" id="timezone" class="autowidth tz_select">