Sn1per has uploaded a new change for review.
https://gerrit.wikimedia.org/r/264609
Change subject: Revert "Set defaultValue property on tz box in
Special:Preferences to fix change check"
......................................................................
Revert "Set defaultValue property on tz box in Special:Preferences to fix
change check"
This reverts commit e8d94f433c43982003fb0d008e1fc8ee04ed7744.
Change-Id: Ib2bdf0e68bafe19360433d20c556d20eb70e054e
---
M resources/src/mediawiki.special/mediawiki.special.preferences.js
1 file changed, 10 insertions(+), 18 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/09/264609/1
diff --git a/resources/src/mediawiki.special/mediawiki.special.preferences.js
b/resources/src/mediawiki.special/mediawiki.special.preferences.js
index 29322f4..92064a6 100644
--- a/resources/src/mediawiki.special/mediawiki.special.preferences.js
+++ b/resources/src/mediawiki.special/mediawiki.special.preferences.js
@@ -210,27 +210,19 @@
var minuteDiff, localTime,
type = $tzSelect.val();
- if ( type === 'other' ) {
- // User specified time zone manually in <input>
+ if ( type === 'guess' ) {
+ // Get browser timezone & fill it in
+ minuteDiff = -( new Date().getTimezoneOffset()
);
+ $tzTextbox.val( minutesToHours( minuteDiff ) );
+ $tzSelect.val( 'other' );
+ $tzTextbox.prop( 'disabled', false );
+ } else if ( type === 'other' ) {
// Grab data from the textbox, parse it.
minuteDiff = hoursToMinutes( $tzTextbox.val() );
} else {
- // Time zone not manually specified by user
- if ( type === 'guess' ) {
- // Get browser timezone & fill it in
- minuteDiff = -( new
Date().getTimezoneOffset() );
- $tzTextbox.val( minutesToHours(
minuteDiff ) );
- $tzSelect.val( 'other' );
- $tzTextbox.prop( 'disabled', false );
- } else {
- // Grab data from the $tzSelect value
- minuteDiff = parseInt( type.split( '|'
)[ 1 ], 10 ) || 0;
- $tzTextbox.val( minutesToHours(
minuteDiff ) );
- }
-
- // Set defaultValue prop on the generated box
so we don't trigger the
- // unsaved preferences check
- $tzTextbox.prop( 'defaultValue',
$tzTextbox.val() );
+ // Grab data from the $tzSelect value
+ minuteDiff = parseInt( type.split( '|' )[ 1 ],
10 ) || 0;
+ $tzTextbox.val( minutesToHours( minuteDiff ) );
}
// Determine local time from server time and minutes
difference, for display.
--
To view, visit https://gerrit.wikimedia.org/r/264609
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2bdf0e68bafe19360433d20c556d20eb70e054e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Sn1per <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits