Skip to content

Commit

Permalink
v2.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nk-o committed Feb 5, 2024
1 parent df41d7a commit 6a3057c
Show file tree
Hide file tree
Showing 12 changed files with 59 additions and 23 deletions.
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Changelog

## [2.2.0] - Feb 5, 2024

- added `edgeCaseMinRowHeight` and `edgeCaseMaxRowHeight` options
- changed `justified-layout` to `better-justified-layout`
- fixed `calculateItemsHeight` option to use row indexes for correct row height calculation

## [2.1.2] - Jun 12, 2022

- added ESM and CJS builds
- added Prettier
- fixed wrong image size calculation when naturalWidth return null or zero
- changed bundler to Rollup
- dropped IE support

## [2.0.0] - Oct 11, 2021

- added `maxRowsCount` option
- added `lastRow` option
- added `transitionDuration` option (CSS transition no more used)
- fixed RTL images position
- removed automatic initialization (use JS manual initialization instead)
- removed deprecated option `resizeThrottle`. Use `resizeDebounce` instead
- removed `-webkit-transform` usage
- removed `merge` dependency

## [1.0.3] - Jul 11, 2020

- added RTL support
- removed `rafl` dependency usage (use native `requestAnimationFrame` instead)
- updated all NPM dependencies

## [1.0.0] - Jun 8, 2018

- initial release
8 changes: 4 additions & 4 deletions dist/fjGallery.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Flickr's Justified Gallery [fjGallery] v2.1.2 (https://flickr-justified-gallery.nkdev.info)
* Flickr's Justified Gallery [fjGallery] v2.2.0 (https://flickr-justified-gallery.nkdev.info)
* Copyright 2024 nK <https://nkdev.info>
* Licensed under MIT (https://github.com/nk-o/flickr-justified-gallery/blob/master/LICENSE)
*/
Expand Down Expand Up @@ -1023,7 +1023,7 @@ class FJGallery {
self.images.forEach((data, imgI) => {
if (justifiedData.boxes[i] && data.width && data.height) {
// calculate additional offset based on actual items height.
if (self.options.calculateItemsHeight && typeof rowsMaxHeight[justifiedData.boxes[i].top] === 'undefined' && Object.keys(rowsMaxHeight).length) {
if (self.options.calculateItemsHeight && typeof rowsMaxHeight[justifiedData.boxes[i].row] === 'undefined' && Object.keys(rowsMaxHeight).length) {
additionalTopOffset += rowsMaxHeight[Object.keys(rowsMaxHeight).pop()] - justifiedData.boxes[imgI - 1].height;
}
if (self.options.transitionDuration && self.justifyCount > 1) {
Expand All @@ -1039,8 +1039,8 @@ class FJGallery {
// calculate actual items height.
if (self.options.calculateItemsHeight) {
const rect = data.$item.getBoundingClientRect();
if (typeof rowsMaxHeight[justifiedData.boxes[i].top] === 'undefined' || rowsMaxHeight[justifiedData.boxes[i].top] < rect.height) {
rowsMaxHeight[justifiedData.boxes[i].top] = rect.height;
if (typeof rowsMaxHeight[justifiedData.boxes[i].row] === 'undefined' || rowsMaxHeight[justifiedData.boxes[i].row] < rect.height) {
rowsMaxHeight[justifiedData.boxes[i].row] = rect.height;
}
}
i += 1;
Expand Down
2 changes: 1 addition & 1 deletion dist/fjGallery.cjs.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/fjGallery.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/fjGallery.esm.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions dist/fjGallery.esm.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/fjGallery.esm.min.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/fjGallery.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/fjGallery.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/fjGallery.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/fjGallery.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "flickr-justified-gallery",
"title": "Flickr's Justified Gallery [fjGallery]",
"version": "2.1.2",
"version": "2.2.0",
"description": "Flickr's justified images gallery",
"license": "MIT",
"homepage": "https://flickr-justified-gallery.nkdev.info",
Expand Down

0 comments on commit 6a3057c

Please sign in to comment.