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