Skip to content

Commit

Permalink
do not trigger live resize when lightbox is closed
Browse files Browse the repository at this point in the history
  • Loading branch information
Wojciech Ryrych committed Feb 25, 2012
1 parent cf1b322 commit 95fb65e
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions widget/lib/jquery.ui.rlightbox.js
Expand Up @@ -703,23 +703,27 @@ $.extend($.ui.rlightbox, {
},

liveResize: function() {
var data = this.data,
var _elementType,
data = this.data;

if ( data.ready ) {
_elementType = data.currentSet.currentElement.type;

// resizes an image when size of the browser window resizes and when Panorama is turned off
if ( data.ready && data.panoramaOn === false && _elementType === "image" ) {
this.updateImageSize();
this.updateLightboxSize();
this.updateTitleWidth();
this.queueCenterContent();
this.panoramaCheckAvailability();
} else if ( data.ready && data.panoramaOn && _elementType === "image" ) {
// otherwise keep the lightbox centered especially when window is bigger than the lightbox
this.queueCenterLightbox();
this.panoramaShrink();
this.panoramaCheckAvailability();
} else if ( data.ready && _elementType !== "image" ) {
this.queueCenterLightbox();
// resizes an image when size of the browser window resizes and when Panorama is turned off
if ( data.ready && data.panoramaOn === false && _elementType === "image" ) {
this.updateImageSize();
this.updateLightboxSize();
this.updateTitleWidth();
this.queueCenterContent();
this.panoramaCheckAvailability();
} else if ( data.ready && data.panoramaOn && _elementType === "image" ) {
// otherwise keep the lightbox centered especially when window is bigger than the lightbox
this.queueCenterLightbox();
this.panoramaShrink();
this.panoramaCheckAvailability();
} else if ( data.ready && _elementType !== "image" ) {
this.queueCenterLightbox();
}
}
},

Expand Down

0 comments on commit 95fb65e

Please sign in to comment.