Santhosh has uploaded a new change for review.

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

Change subject: Update contributions menu to use latest callout widget
......................................................................

Update contributions menu to use latest callout widget

Change-Id: Ia5856bd4f657469a4ac6ca4a3b6b622354206751
---
M modules/campaigns/ext.cx.campaigns.contributionsmenu.js
1 file changed, 7 insertions(+), 21 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/08/211108/1

diff --git a/modules/campaigns/ext.cx.campaigns.contributionsmenu.js 
b/modules/campaigns/ext.cx.campaigns.contributionsmenu.js
index 051477f..7921414 100644
--- a/modules/campaigns/ext.cx.campaigns.contributionsmenu.js
+++ b/modules/campaigns/ext.cx.campaigns.contributionsmenu.js
@@ -89,36 +89,22 @@
                        .append( $myContributions, $myTranslations, $myUploads 
);
 
                $trigger.callout( {
-                       trigger: 'manual',
+                       trigger: 'hover',
                        classes: 'cx-campaign-contributionsmenu',
-                       gravity: $.fn.callout.autoNEW,
+                       direction: $.fn.callout.autoDirection( '1' ),
                        content: $menu
                } );
 
                callout = $trigger.data( 'callout' );
 
-               function hide() {
-                       callout.hide();
-               }
-
-               function show() {
-                       callout.show();
-                       callout.$dialog.one( 'mouseleave', hide );
-                       $( document ).one( 'click', hide );
-                       // Not measuring the shown menu events because the 
trigger is 'hover'
-                       // and there will be a lot of them.
-                       // But it can be easily tracked if somebody uses it to 
reach CX.
-               }
-
-               function ctaShow() {
+               mw.hook( 'mw.cx.betafeature.enabled' ).add( function () {
                        // Show after a few milliseconds to get all position 
calculation correct
-                       setTimeout( show, 500 );
+                       setTimeout( function () {
+                               callout.show();
+                       }, 500 );
                        mw.hook( 'mw.cx.cta.shown' ).fire( campaign );
-               }
+               } );
 
-               $trigger.on( 'mouseover', show );
-
-               mw.hook( 'mw.cx.betafeature.enabled' ).add( ctaShow );
        }
 
        $( function () {

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5856bd4f657469a4ac6ca4a3b6b622354206751
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
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