1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-08 08:35:31 +02:00

[ticket/11302] Correctly select first timezone or selected timezone

While registering, we should default to a given timezone. By selecting the
first timezone by default, this is fulfilled. This doesn't happen
currently, as only the "Select a timezone" selection appears.
If a user selects a timezone during the registration process we should
also make sure that the selected element is still selected; even if we
have to return to the registration page, i.e. if there was an error while
submitting the form. This is currently not the case.
With this patch the javascript code will behave correctly.
Additionally, a duplicate inclusion of timezone.js has been removed as it
was not needed.

PHPBB3-11302
This commit is contained in:
Marc Alexander 2013-01-02 22:05:14 +01:00
parent 208770d7fd
commit e211009eb7
2 changed files with 4 additions and 4 deletions

View File

@ -438,7 +438,10 @@ phpbb.timezone_switch_date = function(keep_selection) {
}
if (typeof keep_selection !== 'undefined' && !keep_selection) {
$('#timezone > option:first').attr('selected', true);
var timezoneOptions = $('#timezone > optgroup option');
if (timezoneOptions.filter(':selected').length <= 0) {
timezoneOptions.filter(':first').attr('selected', true);
}
}
}

View File

@ -104,7 +104,4 @@
</div>
</form>
<script type="text/javascript" src="{T_SUPER_TEMPLATE_PATH}/timezone.js"></script>
<script type="text/javascript">phpbb_preselect_tz_select();</script>
<!-- INCLUDE overall_footer.html -->