aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/assets/javascript/core.js
diff options
context:
space:
mode:
authorIgor Wiedler <igor@wiedler.ch>2012-08-25 17:00:40 +0200
committerIgor Wiedler <igor@wiedler.ch>2012-08-25 17:00:40 +0200
commitae85d43757463e743917f43ee3e014a8b1af85d6 (patch)
treee4c2b7188baadd74cbf968a4174cd5257ccdfb0e /phpBB/assets/javascript/core.js
parentfd9fd71a88fad2b33d75722587dbfc0bd100ae50 (diff)
parentbfdba90a34ad95c7cb9e0bc187cb464c83f8ba59 (diff)
downloadforums-ae85d43757463e743917f43ee3e014a8b1af85d6.tar
forums-ae85d43757463e743917f43ee3e014a8b1af85d6.tar.gz
forums-ae85d43757463e743917f43ee3e014a8b1af85d6.tar.bz2
forums-ae85d43757463e743917f43ee3e014a8b1af85d6.tar.xz
forums-ae85d43757463e743917f43ee3e014a8b1af85d6.zip
Merge remote-tracking branch 'upstream/develop' into feature/dic
* upstream/develop: (259 commits) [prep-release-3.0.11] Bumping version number for 3.0.11 final. [feature/php-events] Fix doc of core.viewonline_overwrite_location [feature/php-events] Fix doc of core.user_set_default_group [feature/php-events] Fix doc of core.generate_smilies_after [feature/php-events] Fix doc of core.delete_user_after [feature/php-events] Fix doc of core.delete_user_before [feature/php-events] Fix doc of core.update_username [feature/php-events] Fix doc of core.memberlist_prepare_profile_data [feature/php-events] Fix doc and position of viewonline_overwrite_location [feature/php-events] Fix doc of core.viewtopic_get_post_data [feature/php-events] Fix doc of core.viewtopic_cache_guest_data [ticket/11061] Add the --dev flag to the composer instructions in README [ticket/11060] Make sure pyrus can install everything on travis [ticket/11059] Use https for the README logo [feature/php-events] Fix acp_manage_forums_update_data_before and is_new_forum [feature/php-events] Fix core.acp_manage_forums_update_data_after vars [ticket/11032] fix language of error displayed [ticket/11052] update search backend constructor everywhere [ticket/11052] pass parametes to search construct while posting [ticket/11054] Fixed $config var description ... Conflicts: phpBB/includes/cron/task/core/tidy_cache.php phpBB/includes/cron/task/core/tidy_search.php
Diffstat (limited to 'phpBB/assets/javascript/core.js')
-rw-r--r--phpBB/assets/javascript/core.js29
1 files changed, 21 insertions, 8 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;
}
}
}