createAFCHInstance: get rid of old click handler before adding new one

When the panel was closed via the “X” and then reopened via the
dropdown menu, it was possible for duplicate warnings to appear because
the old click handler which ran setupReviewPanel() was never removed.
This commit resolves that issue.
This commit is contained in:
theopolisme 2014-05-23 18:36:00 -05:00
parent 29f68565a1
commit b3bb3c7411

View File

@ -714,7 +714,9 @@
.click( function () { .click( function () {
// DIE DIE DIE (...then allow clicks on the launch link again) // DIE DIE DIE (...then allow clicks on the launch link again)
$afch.remove(); $afch.remove();
$afchLaunchLink.one( 'click', createAFCHInstance ); $afchLaunchLink
.off( 'click' ) // Get rid of old handler
.one( 'click', createAFCHInstance );
} ) } )
) )
); );