Do nothing if the clicked region is already selected

Supposed to fix bug
https://bugzilla.wikimedia.org/show_bug.cgi?id=39932
This commit is contained in:
Amir E. Aharoni
2012-10-05 08:38:43 +02:00
parent c5a22fc636
commit 97194de047

View File

@@ -125,21 +125,19 @@
},
click: function( e ) {
// Don't do anything if a region is selected already
if( this.$element.hasClass( 'active' ) ) {
this.$element.removeClass( 'active' );
if ( this.options.noresults ) {
this.options.noresults.call();
}
} else {
// Re-populate the list of languages
this.options.$target.empty();
this.show();
// Make the selected region (and it only) active
$( '.regionselector' ).removeClass( 'active' );
if ( this.regionGroup ) {
// if there is a region group, make it active.
this.$element.addClass( 'active' );
}
return;
}
// Re-populate the list of languages
this.options.$target.empty();
this.show();
// Make the selected region (and it only) active
$( '.regionselector' ).removeClass( 'active' );
if ( this.regionGroup ) {
// if there is a region group, make it active.
this.$element.addClass( 'active' );
}
}
};