Skip to content
This repository has been archived by the owner on Nov 1, 2020. It is now read-only.

apply fit() to all rows, even when they are not complete to fix the misalignment ref #16576 #537

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion js/galleryalbum.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
this.domDef = null;
this.loader = null;
this.preloadOffset = 0;
this.defaultRatio = 1;
};

Album.prototype = {
Expand Down Expand Up @@ -171,7 +172,7 @@
if (more && album.viewedItems < images.length) {
return addRowElements(album, row, images);
}
row.fit();
album.defaultRatio = row.fit(album.defaultRatio);
def.resolve(row);
});
};
Expand Down
6 changes: 4 additions & 2 deletions js/galleryrow.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@
/**
* Resizes the row once it's full
*/
fit: function () {
var scaleRatio = (this.width > this.targetWidth) ? this.targetWidth / this.width : 1;
fit: function (defaultRatio) {
var scaleRatio = (this.width > this.targetWidth) ? this.targetWidth / this.width: defaultRatio;

// This animates the elements when the window is resized
var targetHeight = 4 + (this.targetHeight * scaleRatio);
Expand All @@ -149,6 +149,8 @@
// Restore the rows to their normal opacity. This happens immediately with rows
// containing albums only
this.domDef.css('opacity', 1);

return scaleRatio;
},

/**
Expand Down