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

Change subject: Backport IE and tipsy bugfixes
......................................................................


Backport IE and tipsy bugfixes

This is a compilation of those commits:
2adf7a200886838ff0de5a8b4b61e3bfbbbf231a
184d59e2bfc59ab79fb8830c8a30e76b83518af7

Bug: 72516
Bug: 73337
Change-Id: I4cda3b508a16b7320ff367b269763aebd8949478
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/1005
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/996
---
M resources/mmv/mmv.lightboxinterface.js
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.metadataPanelScroller.js
M resources/mmv/ui/mmv.ui.stripeButtons.js
M resources/mmv/ui/mmv.ui.tipsyDialog.js
7 files changed, 50 insertions(+), 48 deletions(-)

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



diff --git a/resources/mmv/mmv.lightboxinterface.js 
b/resources/mmv/mmv.lightboxinterface.js
index 2850671..0eac0bf 100644
--- a/resources/mmv/mmv.lightboxinterface.js
+++ b/resources/mmv/mmv.lightboxinterface.js
@@ -224,11 +224,12 @@
        LIP.unattach = function () {
                mw.mmv.actionLogger.log( 'close' );
 
+               // Has to happen first so that the scroller can freeze with 
visible elements
+               this.panel.unattach();
+
                this.$wrapper.detach();
 
                this.currentlyAttached = false;
-
-               this.panel.unattach();
 
                this.canvas.unattach();
 
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..c88392c 100644
--- a/resources/mmv/ui/mmv.ui.metadataPanel.js
+++ b/resources/mmv/ui/mmv.ui.metadataPanel.js
@@ -80,11 +80,26 @@
                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.scroller.freezeHeight();
+
+               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.metadataPanelScroller.js 
b/resources/mmv/ui/mmv.ui.metadataPanelScroller.js
index 57fbf5b..8394021 100644
--- a/resources/mmv/ui/mmv.ui.metadataPanelScroller.js
+++ b/resources/mmv/ui/mmv.ui.metadataPanelScroller.js
@@ -114,6 +114,10 @@
         * unfreezeHeight after the panel has been populeted with the new 
metadata.
         */
        MPSP.freezeHeight = function () {
+               if ( !this.$container.is( ':visible' ) ) {
+                       return;
+               }
+
                var scrollTop = $.scrollTo().scrollTop(),
                        scrollTopWhenOpen = this.getScrollTopWhenOpen();
 
@@ -122,6 +126,10 @@
        };
 
        MPSP.unfreezeHeight = function () {
+               if ( !this.$container.is( ':visible' ) ) {
+                       return;
+               }
+
                this.$container.css( 'min-height', '' );
                if ( this.panelWasFullyOpen ) {
                        $.scrollTo( this.getScrollTopWhenOpen() );
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/174718
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4cda3b508a16b7320ff367b269763aebd8949478
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MultimediaViewer
Gerrit-Branch: wmf/1.25wmf8
Gerrit-Owner: Gilles <[email protected]>
Gerrit-Reviewer: Gilles <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to