Skip to content

Commit

Permalink
Fix me...
Browse files Browse the repository at this point in the history
  • Loading branch information
andi34 committed Sep 5, 2020
1 parent d9cd2ec commit 07ff53d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 1 addition & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,7 @@
// Auto sized images
{
src: 'https://farm4.staticflickr.com/3920/15008465772_d50c8f0531_h.jpg',
autoSize: true,
title: 'Example caption. Image height and width defined via "autoSize: true"'
autoSize: true
},
{
src: 'https://farm6.staticflickr.com/5591/15008867125_b61960af01_h.jpg',
Expand Down
1 change: 1 addition & 0 deletions src/js/gestures.js
Original file line number Diff line number Diff line change
Expand Up @@ -984,6 +984,7 @@ var _gestureStartTime,
);

if (itemChanged) {
self.ui.resetCaption();
self.updateCurrItem(true);
}

Expand Down
6 changes: 3 additions & 3 deletions src/js/ui/photoswipe-ui-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@

// If allowLongCaptions is true, position caption just under picture and show "Expand" button if necessary
if (_options.allowLongCaptions) {
var imagePositionTop = item.initialPosition.y;
var apparentImageHeight = Math.round(item.h * item.initialZoomLevel);
var imagePositionTop = 0;
var apparentImageHeight = 1024;
var gapTop = item.vGap.top;

ui.resetCaption();
var naturalCaptionHeight = innerCaptionElement.clientHeight;

var captionCtrl = captionElement.querySelector('.pswp__button--caption--ctrl');
var captionCtrl = document.querySelector('.pswp__button--caption--ctrl');

_setLayoutData(captionElement, imagePositionTop, apparentImageHeight, gapTop, naturalCaptionHeight);
var layoutData = _getLayoutData(captionElement);
Expand Down

0 comments on commit 07ff53d

Please sign in to comment.