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
This commit is contained in:
Mark Holmquist 2014-07-14 14:51:06 -07:00 committed by Gilles
parent a57a606ee5
commit 3e2759cd7b
2 changed files with 10 additions and 2 deletions

View file

@ -61,7 +61,12 @@
MPP.unattach = function() { MPP.unattach = function() {
this.$title.tipsy( 'hide' ); 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-author' ).tipsy( 'hide' );
this.$titleAndCredit.find( '.mw-mmv-source' ).tipsy( 'hide' ); this.$titleAndCredit.find( '.mw-mmv-source' ).tipsy( 'hide' );

View file

@ -431,7 +431,10 @@
this.clearTimer( 'feedbackTooltip.show' ); this.clearTimer( 'feedbackTooltip.show' );
$.each( this.buttons, function ( name, $button ) { $.each( this.buttons, function ( name, $button ) {
$button.tipsy( 'hide' ); // Tipsy's not enabled on every button
if ( $button.data( 'tipsy' ) ) {
$button.tipsy( 'hide' );
}
} ); } );
}; };