Merge "Fix fullscreen bug where image was replaced with self"

This commit is contained in:
jenkins-bot 2014-02-13 09:14:18 +00:00 committed by Gerrit Code Review
commit 52a0e16147
2 changed files with 9 additions and 5 deletions

View file

@ -156,6 +156,10 @@
};
LIP.replaceImageWith = function ( imageEle ) {
if ( this.$image.is( imageEle ) ) { // http://bugs.jquery.com/ticket/4087
return;
}
var $image = $( imageEle );
this.currentImage.src = imageEle.src;
@ -178,8 +182,6 @@
return;
}
this.viewer.resize( this );
if ( this.isFullscreen ) {
// When entering fullscreen without a mousemove, the browser
// still thinks that the cursor is where it was prior to entering

View file

@ -85,6 +85,7 @@
if ( this.resizeListener ) {
window.removeEventListener( 'resize', this.resizeListener );
this.resizeListener = null;
}
};
@ -167,9 +168,10 @@
// Capture listener so we can remove it later, otherwise
// we are going to leak listeners !
this.resizeListener = function () { iface.resizeCallback(); };
window.addEventListener( 'resize', this.resizeListener );
if ( !this.resizeListener ) {
this.resizeListener = function () { iface.resizeCallback(); };
window.addEventListener( 'resize', this.resizeListener );
}
lightboxHooks.callAll( 'imageLoaded', this );
};