TheDJ has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/264603

Change subject: [Do not merge] Ignore select state if there was no default
......................................................................

[Do not merge] Ignore select state if there was no default

Did not test this, but might be an alternative to:
I18e14cfe70635d410c15e83426f9f3093a9439df ?

Bug: T122702
Change-Id: I1cf27267e60f2077180b7bb6a3bc29fded4b67f6
---
M resources/src/mediawiki.special/mediawiki.special.preferences.js
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/03/264603/1

diff --git a/resources/src/mediawiki.special/mediawiki.special.preferences.js 
b/resources/src/mediawiki.special/mediawiki.special.preferences.js
index c2b9a4f..c293e48 100644
--- a/resources/src/mediawiki.special/mediawiki.special.preferences.js
+++ b/resources/src/mediawiki.special/mediawiki.special.preferences.js
@@ -273,7 +273,8 @@
                                $input = $( input );
 
                                // Different types of inputs have different 
methods for accessing defaults
-                               if ( $input.is( 'select' ) ) { // <select> has 
the property defaultSelected for each option
+                               if ( $input.is( 'select' ) && $input.find( 
'[selected]' ).length > 0 ) { // ignore lists without a default
+                                       // <select> has the property 
defaultSelected for each option
                                        for ( optIndex = 0; optIndex < 
input.options.length; optIndex++ ) {
                                                opt = input.options[ optIndex ];
                                                if ( opt.selected !== 
opt.defaultSelected ) {
@@ -286,7 +287,7 @@
                                                if ( input.checked !== 
input.defaultChecked ) {
                                                        return true;
                                                }
-                                       } else if ( input.value !== 
input.defaultValue ) {
+                                       } else if ( input.hasAttribute( 'value' 
) && input.value !== input.defaultValue ) {
                                                return true;
                                        }
                                }

-- 
To view, visit https://gerrit.wikimedia.org/r/264603
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1cf27267e60f2077180b7bb6a3bc29fded4b67f6
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: TheDJ <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to