Santhosh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/54824


Change subject: (Bug 45559) - [TUX] Clicking group selector does nothing until 
data is loaded
......................................................................

(Bug 45559) - [TUX] Clicking group selector does nothing until data is loaded

Position the menu on correct place.

Change-Id: I2cfb83f6b313df15095f101e7667ac0e34d5f60b
---
M resources/js/ext.translate.groupselector.js
1 file changed, 5 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Translate 
refs/changes/24/54824/1

diff --git a/resources/js/ext.translate.groupselector.js 
b/resources/js/ext.translate.groupselector.js
index 9e1eaf8..c2be32f 100644
--- a/resources/js/ext.translate.groupselector.js
+++ b/resources/js/ext.translate.groupselector.js
@@ -23,7 +23,6 @@
                        this.parentGroupId = this.$group.data( 'msggroupid' );
                        if ( this.hasChildGroups( this.parentGroupId ) ) {
                                this.prepareSelectorMenu();
-                               this.position();
                                this.listen();
                                if ( mw.translate.messageGroups !== {} ) {
                                        // If data is ready, render now.
@@ -102,7 +101,7 @@
                        $( '.ext-translate-msggroup-selector-menu.opened' )
                                .removeClass( 'opened' )
                                .hide();
-
+                       this.position();
                        this.$menu.addClass( 'opened' ).show();
                        // Keep the focus in the message group search box.
                        this.$menu.find( 
'input.ext-translate-msggroup-search-input' ).focus();
@@ -244,10 +243,12 @@
                 * Position the menu
                 */
                position: function () {
-                       var position = this.$group.offset(),
+                       var position = $.extend( {}, this.$group.offset(), {
+                                       height: this.$group[0].offsetHeight
+                               } ),
                                menuLeft;
 
-                       this.$menu.css( 'top', position.top + 
this.$group.outerHeight() );
+                       this.$menu.css( 'top', position.top + position.height );
 
                        if ( $( 'body' ).hasClass( 'rtl' ) ) {
                                menuLeft = position.left - 
this.$menu.outerWidth() + 90;

-- 
To view, visit https://gerrit.wikimedia.org/r/54824
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2cfb83f6b313df15095f101e7667ac0e34d5f60b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Translate
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to