Skip to content

Commit

Permalink
Fixed lightbox bugs. See changelog for 1.03
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebobo committed May 31, 2013
1 parent ba79b5b commit 6c535f2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
11 changes: 6 additions & 5 deletions dist/jquery.rondell.js
Expand Up @@ -2,7 +2,7 @@
jQuery rondell plugin
@name jquery.rondell.js
@author Sebastian Helzle (sebastian@helzle.net or @sebobo)
@version 1.0.2
@version 1.0.3
@date 04/01/2013
@category jQuery plugin
@copyright (c) 2009-2013 Sebastian Helzle (www.sebastianhelzle.net)
Expand All @@ -17,7 +17,7 @@ var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments)

var $document, $window, Rondell, closeLightbox, delayCall, getActiveRondell, getLightbox, lightboxIsVisible, resizeLightbox, resizeTimer, updateLightbox, _base;
$.rondell || ($.rondell = {
version: '1.0.2',
version: '1.0.3',
name: 'rondell',
lightbox: {
instance: void 0,
Expand Down Expand Up @@ -464,7 +464,7 @@ var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments)
this.currentLayer = Math.max(0, Math.min(this.currentLayer || Math.round(this.maxItems / 2), this.maxItems));
}
if (this.visibleItems === "auto") {
this.visibleItems = Math.max(2, Math.floor(this.maxItems / 2));
this.visibleItems = Math.max(2, ~~(this.maxItems / 2));
}
controls = this.controls;
if (controls.enabled) {
Expand Down Expand Up @@ -817,7 +817,7 @@ var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments)
lightbox = getLightbox();
lightboxContent = $('.rondell-lightbox-content', lightbox);
if (!lightboxIsVisible()) {
lightbox.add(lightboxContent).css('display', 'none');
lightbox.add(lightboxContent).css('visibility', 'hidden');
}
return lightboxContent.stop().fadeTo(100, 0, function() {
var attr, content, icon, iconCopy, linkTarget, linkUrl, _i, _len, _ref;
Expand Down Expand Up @@ -896,6 +896,7 @@ var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments)
winHeight = $window.innerHeight();
windowPadding = 20;
focusedItem = getActiveRondell()._focusedItem;
$lightbox.css('display', 'block');
image = $('img:first', $lightboxContent);
if (image.length) {
if (!focusedItem.lightboxImageWidth) {
Expand All @@ -917,7 +918,7 @@ var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments)
}
image.attr('width', imageWidth).attr('height', imageHeight);
}
$lightbox.css('display', 'block');
$lightbox.add($lightboxContent).css('visibility', 'visible');
newWidth = $lightboxContent.outerWidth();
newHeight = $lightboxContent.outerHeight();
newProps = {
Expand Down

0 comments on commit 6c535f2

Please sign in to comment.