Ignore name-less inputs on preference page confirmCloseWindow check

Ignore any fields that will not be submitted when checking
if the user has made changes to the Preferences form.

Bug: T122702
Change-Id: I1cf27267e60f2077180b7bb6a3bc29fded4b67f6
This commit is contained in:
Derk-Jan Hartman 2016-01-17 12:24:28 -05:00 committed by Bartosz Dziewoński
parent 899095d980
commit 614dd71670

View file

@ -266,7 +266,7 @@
// Check if all of the form values are unchanged
function isPrefsChanged() {
var inputs = $( '#mw-prefs-form :input' ),
var inputs = $( '#mw-prefs-form :input[name]' ),
input, $input, inputType,
index, optIndex,
opt;
@ -276,7 +276,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' ) ) {
// <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 ) {