Remove the temporary click handler once the final one is installed

Change-Id: I166ab85e358c74db486709ca062897c8cf541cfa
Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/391
This commit is contained in:
Gergő Tisza 2014-03-31 18:19:00 +00:00
parent 94588c9859
commit 2dc258b309
2 changed files with 4 additions and 1 deletions

View file

@ -168,6 +168,9 @@
$link.add( $enlarge ).click( function ( e ) {
return bs.click( this, e, title );
} );
// now that we have set up our real click handler we can we can remove the temporary
// handler added in mmv.head.js which just replays clicks to the real handler
$( document ).off( 'click.mmv-head' );
this.thumbsReadyDeferred.resolve();
};

View file

@ -24,7 +24,7 @@
return;
}
$document.on( 'click', 'a.image', function ( e ) {
$document.on( 'click.mmv-head', 'a.image', function ( e ) {
// Do not interfere with non-left clicks or if modifier keys are pressed.
// Also, make sure we do not get in a loop.
if ( ( e.which !== 0 && e.which !== 1 ) || e.altKey || e.ctrlKey || e.shiftKey || e.metaKey || e.replayed ) {