Close language settings when clicked outside

To make the behavior consistent with ULS langauge selection window.

This also avoid multiple language settings screen appearing in rare
case of using two entry points to access language settings one after
another.

Bug: 50559
Change-Id: I990eb6402085290df314db0a75235e0ad7b2fd55
This commit is contained in:
Santhosh Thottingal
2013-07-22 13:40:23 +05:30
parent 8a90546e1b
commit bf1d62ba42

View File

@@ -67,6 +67,14 @@
this.$element.on( 'click', $.proxy( this.click, this ) );
this.$window.find( '#languagesettings-close' )
.on( 'click', $.proxy( this.close, this ) );
// Hide the window when clicked outside
$( 'html' ).click( $.proxy( this.close, this ) );
// ... but when clicked on window do not hide.
this.$window.on( 'click', function () {
return false;
} );
},
render: function () {
@@ -155,7 +163,8 @@
this.render();
this.initialized = true;
}
// close model windows close, if they hide on page click
$( 'html' ).click();
this.$window.i18n();
this.shown = true;
this.$window.show();
@@ -202,7 +211,10 @@
}
},
click: function () {
click: function ( e ) {
e.stopPropagation();
e.preventDefault();
if ( this.shown ) {
this.hide();
} else {