Prevent page scroll to top while clicking on language settings icon

If the language settings window is not visible, all calculations
will go wrong and page will scroll to 0 position.

So call scrollIntoView only when the element is visible.

The $.fn.scrollIntoView defined in jquery.uls core may be unnecessary
now since it is available natively on DOM elements.

Bug: T178188
Change-Id: I461fa9eb7c51cd277bebd3a04cfcc0eed9793c4e
This commit is contained in:
Santhosh Thottingal
2018-01-04 10:17:03 +05:30
parent 030bc49ad2
commit f536b3969d

View File

@@ -149,7 +149,9 @@
var $this = $( this );
$this.data( 'module' ).render();
if ( languageSettings.$window.is( ':visible' ) ) {
languageSettings.$window.scrollIntoView();
}
$settingsMenuItems.find( '.menu-section' ).removeClass( 'active' );
$this.addClass( 'active' );
} );