-
-
Notifications
You must be signed in to change notification settings - Fork 308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes Justify layout #2766
Fixes Justify layout #2766
Conversation
resources/js/layouts/useJustify.ts
Outdated
} | ||
|
||
// console.log("baseWidth - paddingLeftRight - scrollBarWidth") | ||
// console.log(baseWidth - paddingLeftRight - scrollBarWidth) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
console.log debug code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hahaha :)
@ildyria Thank you. However, I am still experiencing the behavior mentioned in point 2, that the layout changes slightly (= the right gap becomes bigger) when the album is redrawn like after switching layout or selecting an image. This is even more pronounced when the timeline is activated. I used the remains of the debug code 😉 to figure out why and I could see, that the values for the One way I could easily solve this was by performing all calculations based on the browser window instead of the element sizes that change during page rendering: - const baseWidth = Math.floor(baseElem.offsetWidth - padding);
- const widthEl = parseInt(getComputedStyle(el).width);
+ const baseWidth = Math.floor(window.innerWidth - padding);
+ const widthEl = window.innerWidth; With that change both the normal as well the timeline view work without problems. However, I am not so deep into the code to judge if it’s a good idea to base everything on the browser windows size. Maybe you have a better idea or would this be a viable Option? |
👍 I've tested the new changes and can confirm it now works as expected. |
Some mistakes were made...