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:
@@ -67,6 +67,14 @@
|
|||||||
this.$element.on( 'click', $.proxy( this.click, this ) );
|
this.$element.on( 'click', $.proxy( this.click, this ) );
|
||||||
this.$window.find( '#languagesettings-close' )
|
this.$window.find( '#languagesettings-close' )
|
||||||
.on( 'click', $.proxy( this.close, this ) );
|
.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 () {
|
render: function () {
|
||||||
@@ -155,7 +163,8 @@
|
|||||||
this.render();
|
this.render();
|
||||||
this.initialized = true;
|
this.initialized = true;
|
||||||
}
|
}
|
||||||
|
// close model windows close, if they hide on page click
|
||||||
|
$( 'html' ).click();
|
||||||
this.$window.i18n();
|
this.$window.i18n();
|
||||||
this.shown = true;
|
this.shown = true;
|
||||||
this.$window.show();
|
this.$window.show();
|
||||||
@@ -202,7 +211,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
click: function () {
|
click: function ( e ) {
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
|
||||||
if ( this.shown ) {
|
if ( this.shown ) {
|
||||||
this.hide();
|
this.hide();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user