jenkins-bot has submitted this change and it was merged.

Change subject: Get rid of phantom tipsy bubbles that can appear after closing
......................................................................


Get rid of phantom tipsy bubbles that can appear after closing

Bug: 72516
Change-Id: Ia638688afc4d4373065c0d8a19dfcc11a7e9561e
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/1005
---
M resources/mmv/ui/mmv.ui.canvas.js
M resources/mmv/ui/mmv.ui.canvasButtons.js
M resources/mmv/ui/mmv.ui.metadataPanel.js
M resources/mmv/ui/mmv.ui.stripeButtons.js
M resources/mmv/ui/mmv.ui.tipsyDialog.js
5 files changed, 37 insertions(+), 46 deletions(-)

Approvals:
  MarkTraceur: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/resources/mmv/ui/mmv.ui.canvas.js 
b/resources/mmv/ui/mmv.ui.canvas.js
index 0e07180..43ee9d0 100644
--- a/resources/mmv/ui/mmv.ui.canvas.js
+++ b/resources/mmv/ui/mmv.ui.canvas.js
@@ -233,10 +233,6 @@
                $( window ).off( 'resize.mmv-canvas' );
 
                this.$imageDiv.off( 'click.mmv-canvas' );
-
-               if ( this.$image ) {
-                       this.$image.tipsy( 'hide' );
-               }
        };
 
        /**
diff --git a/resources/mmv/ui/mmv.ui.canvasButtons.js 
b/resources/mmv/ui/mmv.ui.canvasButtons.js
index 414951b..9f2af0e 100644
--- a/resources/mmv/ui/mmv.ui.canvasButtons.js
+++ b/resources/mmv/ui/mmv.ui.canvasButtons.js
@@ -240,17 +240,30 @@
                this.handleEvent( 'mmv-options-closed', function () {
                        buttons.$options.removeClass( 'open' );
                } );
+
+               this.$download
+                       .add( this.$reuse )
+                       .add( this.$options )
+                       .add( this.$close )
+                       .add( this.$fullscreen )
+                       .each( function () {
+                               $( this ).tipsy( 'enable' );
+                       } );
        };
 
        /**
         * Removes all UI things from the DOM, or hides them
         */
        CBP.unattach = function () {
-               this.$download.off( 'click.mmv-canvasButtons' ).tipsy( 'hide' );
-               this.$reuse.off( 'click.mmv-canvasButtons' ).tipsy( 'hide' );
-               this.$options.off( 'click.mmv-canvasButtons' ).tipsy( 'hide' );
-               this.$close.tipsy( 'hide' );
-               this.$fullscreen.tipsy( 'hide' );
+               this.$download
+                       .add( this.$reuse )
+                       .add( this.$options )
+                       .add( this.$close )
+                       .add( this.$fullscreen )
+                       .off( 'click.mmv-canvasButtons' )
+                       .each( function () {
+                               $( this ).tipsy( 'hide' ).tipsy( 'disable' );
+                       } );
        };
 
        CBP.empty = function () {
diff --git a/resources/mmv/ui/mmv.ui.metadataPanel.js 
b/resources/mmv/ui/mmv.ui.metadataPanel.js
index 82c5ab3..81412e2 100644
--- a/resources/mmv/ui/mmv.ui.metadataPanel.js
+++ b/resources/mmv/ui/mmv.ui.metadataPanel.js
@@ -80,11 +80,24 @@
                this.handleEvent( 'jq-fullscreen-change.lip', function() {
                        panel.hideTruncatedText();
                } );
+
+               this.$title
+                       .add( this.title.$ellipsis )
+                       .add( this.$authorAndSource )
+                       .add( this.creditField.$ellipsis )
+                       .each( function () {
+                               $( this ).tipsy( 'enable' );
+                       } );
        };
 
        MPP.unattach = function() {
-               this.$title.add( this.title.$ellipsis ).tipsy( 'hide' );
-               this.$authorAndSource.add( this.creditField.$ellipsis ).tipsy( 
'hide' );
+               this.$title
+                       .add( this.title.$ellipsis )
+                       .add( this.$authorAndSource )
+                       .add( this.creditField.$ellipsis )
+                       .each( function () {
+                               $( this ).tipsy( 'hide' ).tipsy( 'disable' );
+                       } );
 
                this.scroller.unattach();
                this.buttons.unattach();
diff --git a/resources/mmv/ui/mmv.ui.stripeButtons.js 
b/resources/mmv/ui/mmv.ui.stripeButtons.js
index 79a71b5..667888f 100644
--- a/resources/mmv/ui/mmv.ui.stripeButtons.js
+++ b/resources/mmv/ui/mmv.ui.stripeButtons.js
@@ -49,29 +49,14 @@
         * @protected
         * Creates a new button on the metadata stripe.
         * @param {string} cssClass CSS class name for the button
-        * @param {string} text HTML code for the button text
-        * @param {string} popupText HTML code for the popup text
         */
-       SBP.createButton = function ( cssClass, text, popupText ) {
-               var $button,
-                       $label,
-                       tooltipDelay = mw.config.get( 'wgMultimediaViewer' 
).tooltipDelay;
+       SBP.createButton = function ( cssClass ) {
+               var $button;
 
                $button = $( '<a>' )
                        .addClass( 'mw-mmv-stripe-button empty ' + cssClass )
                        // elements are right-floated so we use prepend instead 
of append to keep the order
                        .prependTo( this.$buttonContainer );
-
-               if ( text ) {
-                       $label = $( '<span>' ).addClass( 
'mw-mmv-stripe-button-text' ).text( text );
-                       $button.append( $label ).addClass( 'has-label' );
-               }
-               if ( popupText ) {
-                       $button.prop( 'title', popupText ).tipsy( {
-                               gravity: this.correctEW( 'se' ),
-                               delayIn: tooltipDelay
-                       } );
-               }
 
                return $button;
        };
@@ -138,22 +123,6 @@
 
                this.buttons.$descriptionPage.attr( { href: null, title: null, 
'original-title': null } )
                        .removeClass( 'mw-mmv-repo-button-commons' );
-       };
-
-       /**
-        * Clears listeners.
-        */
-       SBP.unattach = function () {
-               mw.mmv.ui.Element.prototype.unattach.call( this );
-
-               this.clearTimer( 'feedbackTooltip.show' );
-
-               $.each( this.buttons, function ( name, $button ) {
-                       // Tipsy's not enabled on every button
-                       if ( $button.data( 'tipsy' ) ) {
-                               $button.tipsy( 'hide' );
-                       }
-               } );
        };
 
        mw.mmv.ui.StripeButtons = StripeButtons;
diff --git a/resources/mmv/ui/mmv.ui.tipsyDialog.js 
b/resources/mmv/ui/mmv.ui.tipsyDialog.js
index 64ca4f7..c078340 100644
--- a/resources/mmv/ui/mmv.ui.tipsyDialog.js
+++ b/resources/mmv/ui/mmv.ui.tipsyDialog.js
@@ -129,7 +129,7 @@
         */
        TDP.open = function () {
                this.init();
-               this.$anchor.tipsy( 'show' );
+               this.$anchor.tipsy( 'enable' ).tipsy( 'show' );
        };
 
        /**
@@ -137,7 +137,7 @@
         */
        TDP.close = function () {
                if ( this.isInitialized() ) {
-                       this.$anchor.tipsy( 'hide' );
+                       this.$anchor.tipsy( 'hide' ).tipsy( 'disable' );
                }
        };
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia638688afc4d4373065c0d8a19dfcc11a7e9561e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: master
Gerrit-Owner: Gilles <[email protected]>
Gerrit-Reviewer: Gilles <[email protected]>
Gerrit-Reviewer: MarkTraceur <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to