aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/assets
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-07-23 18:13:22 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-07-23 18:13:22 +0200
commit5bdec7669b742286a6808438a453827ce6f493d8 (patch)
tree2119c57efa5a56473d631ff69db1693829c877e2 /phpBB/assets
parent22951e43674d023f43edc8da7ade33f01b5428c8 (diff)
downloadforums-5bdec7669b742286a6808438a453827ce6f493d8.tar
forums-5bdec7669b742286a6808438a453827ce6f493d8.tar.gz
forums-5bdec7669b742286a6808438a453827ce6f493d8.tar.bz2
forums-5bdec7669b742286a6808438a453827ce6f493d8.tar.xz
forums-5bdec7669b742286a6808438a453827ce6f493d8.zip
[ticket/11003] Ability to show full list of timezones with JavaScript enabled
This also fixes the problem with Chrome which displayed all timezones. PHPBB3-11007 PHPBB3-11003
Diffstat (limited to 'phpBB/assets')
-rw-r--r--phpBB/assets/javascript/core.js15
1 files changed, 13 insertions, 2 deletions
diff --git a/phpBB/assets/javascript/core.js b/phpBB/assets/javascript/core.js
index c40852388e..669f662b16 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');