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:
@@ -149,7 +149,9 @@
|
||||
var $this = $( this );
|
||||
|
||||
$this.data( 'module' ).render();
|
||||
languageSettings.$window.scrollIntoView();
|
||||
if ( languageSettings.$window.is( ':visible' ) ) {
|
||||
languageSettings.$window.scrollIntoView();
|
||||
}
|
||||
$settingsMenuItems.find( '.menu-section' ).removeClass( 'active' );
|
||||
$this.addClass( 'active' );
|
||||
} );
|
||||
|
||||
Reference in New Issue
Block a user