From 3e2759cd7b1517a5d0a79e2954cdc9cb777aa016 Mon Sep 17 00:00:00 2001 From: Mark Holmquist Date: Mon, 14 Jul 2014 14:51:06 -0700 Subject: [PATCH] Fix a few issues in unattach Check for tipsy-ness, and for the existence of the opt out button. The latter doesn't affect prod, but the former might. Change-Id: Ia5ae8b160626d27750cb3e4938c27a461b9f0c64 --- resources/mmv/ui/mmv.ui.metadataPanel.js | 7 ++++++- resources/mmv/ui/mmv.ui.stripeButtons.js | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/resources/mmv/ui/mmv.ui.metadataPanel.js b/resources/mmv/ui/mmv.ui.metadataPanel.js index b04cbdfcb..25a3289a7 100644 --- a/resources/mmv/ui/mmv.ui.metadataPanel.js +++ b/resources/mmv/ui/mmv.ui.metadataPanel.js @@ -61,7 +61,12 @@ MPP.unattach = function() { this.$title.tipsy( 'hide' ); - this.$mmvOptOutLink.tipsy( 'hide' ); + + // This is created conditionally if MMV is in beta + if ( this.$mmvOptOutLink ) { + this.$mmvOptOutLink.tipsy( 'hide' ); + } + this.$titleAndCredit.find( '.mw-mmv-author' ).tipsy( 'hide' ); this.$titleAndCredit.find( '.mw-mmv-source' ).tipsy( 'hide' ); diff --git a/resources/mmv/ui/mmv.ui.stripeButtons.js b/resources/mmv/ui/mmv.ui.stripeButtons.js index 4a40ea0da..403f385a2 100644 --- a/resources/mmv/ui/mmv.ui.stripeButtons.js +++ b/resources/mmv/ui/mmv.ui.stripeButtons.js @@ -431,7 +431,10 @@ this.clearTimer( 'feedbackTooltip.show' ); $.each( this.buttons, function ( name, $button ) { - $button.tipsy( 'hide' ); + // Tipsy's not enabled on every button + if ( $button.data( 'tipsy' ) ) { + $button.tipsy( 'hide' ); + } } ); };