diff --git a/resources/js/ext.uls.interface.js b/resources/js/ext.uls.interface.js index fe56f4c9..cc0c5c77 100644 --- a/resources/js/ext.uls.interface.js +++ b/resources/js/ext.uls.interface.js @@ -162,7 +162,7 @@ ulsPopupPosition = 'after'; } // Reverse for RTL - if ( $( 'html' ).prop( 'dir' ) === 'rtl' ) { + if ( $( document.documentElement ).prop( 'dir' ) === 'rtl' ) { ulsPopupPosition = ( ulsPopupPosition === 'after' ) ? 'before' : 'after'; } } else { diff --git a/resources/js/ext.uls.languagesettings.js b/resources/js/ext.uls.languagesettings.js index cd01a3a8..e7b24fc4 100644 --- a/resources/js/ext.uls.languagesettings.js +++ b/resources/js/ext.uls.languagesettings.js @@ -81,7 +81,7 @@ this.$window.find( 'button.uls-settings-apply' ) .on( 'click', mw.hook( 'mw.uls.settings.apply' ).fire.bind( this ) ); // Hide the window when clicked outside - $( 'html' ).on( 'click', this.hide.bind( this ) ); + $( document.documentElement ).on( 'click', this.hide.bind( this ) ); // ... but when clicked on window do not hide. this.$window.on( 'click', function ( event ) { @@ -190,7 +190,7 @@ this.initialized = true; } // Close other modal windows which listen to click events outside them - $( 'html' ).trigger( 'click' ); + $( document.documentElement ).trigger( 'click' ); this.i18n(); // Every time we show this window, make sure the current // settings panels is up-to-date. So just click on active menu item.