getgrav / grav-plugin-featherlight

Grav Featherlight Plugin
https://getgrav.org
MIT License
30 stars 9 forks source link

Update? #17

Closed adrian5 closed 7 years ago

adrian5 commented 7 years ago

Any chance of an update? Featherlight is at 1.7.

geoffreymtroyer commented 7 years ago

I would love to see this as well. I'm having an issue with scrollbars in the lightbox. Maybe an update would help me.

adrian5 commented 7 years ago

In my case there's an issue with images taller than the viewport not being centered within the lightbox. I couldn't replicate it in Featherlight's CodePen demo.

p.s. Accidentally closed the issue; reopened.

awrog commented 7 years ago

+1, an update would be great! (experiencing some 'stutter/bouncing'-effects when opening an image with lightbox).

flaviocopes commented 7 years ago

I posted this Pull Request https://github.com/getgrav/grav-plugin-featherlight/pull/18 that updates to Featherlight 1.7.1. Can you test it (zip file: https://github.com/getgrav/grav-plugin-featherlight/archive/feature/update-featherlight.zip) to make sure there are no breaking changes in your sites?

adrian5 commented 7 years ago

I fired it up and did some clicking around. Couldn't find any breaking changes.

Just a heads ups for the others: This version has a different issue regarding scrollbars (fix, presumably) that the old one didn't, but that's on featherlight, not the Grav plugin. I hope the featherlight maintainer(s) will fix it soon. I never feel good about manually editing code that arrives through a content delivery system, because one might forget about it (and the side effects) as updates roll in.

Update:

If you want to try a manually fix, the following seems to work for me:

Inside featherlight.min.js, replace

var c=Math.max(a/(parseInt(this.$content.parent().css("width"),10)-1),b/(parseInt(this.$content.parent().css("height"),10)-1));

with

var c=Math.max(a/(this.$content.parent().width()-1),b/(this.$content.parent().height()-1));

This gives me properly sized images without scrollbars.

Btw, I first tried various CSS-based fixes floating on the web, but none gave satisfying results. So save yourself the time if the javascript solution works.

awrog commented 7 years ago

Thanks for the update! No change as far as I can see.
Unfortunately, the 'stutter' still remains (I use a 920 x 1080 display), you can observe this behaviour here
(the image is opened with ![](/images/nicodemus-doop.jpg?lightbox=1280,1280&cropZoom=400,350) ) The fix by @adrian5 does not change this 'stutter'

adrian5 commented 7 years ago

@awrog: I checked your link, and the nicodemus-doop image opens smoothly here (with a simulated 920x1080 window as well). I'm using a beefy workstation though, so maybe that masks existing performance issues.

awrog commented 7 years ago

Hi @adrian5 , thanks. I just tried it on anothe computer (a surface pro (i5)). As long as the image (or the lightbox dimensions) is smaller than the resolution of the screen, all goes smoothly. When you zoom in your browser screen until the image will no longer fit, you'll see what I mean. I guess it has probably nothing to do with GRAV or the plugin. Thanks for your trouble!

geoffreymtroyer commented 7 years ago

I appreciate the update! It didn't break anything for me, however, I don't have much of a website yet. The fix that Adrian showed fixed my scroll bar problems! Now I just need to tie a string around my finger to remember I changed featherlight.min.js.

adrian5 commented 7 years ago

@flaviocopes The featherlight maintainer has merged the fix as version 1.7.7, so if no other issues regarding the Grav plugin crop up, that'd be a good candidate to adopt I think, if you find the time.

flaviocopes commented 7 years ago

Ouch I updated to 1.7.1 as that was listed in the project homepage as latest https://noelboss.github.io/featherlight/

Didn't realize 6 releases went in since!

flaviocopes commented 7 years ago

I synced the PR to 1.7.7, care to test again? Thanks!

flaviocopes commented 7 years ago

https://github.com/getgrav/grav-plugin-featherlight/pull/18

geoffreymtroyer commented 7 years ago

1.7.7 works fine for me. Looks like the scroll bar fix is in this version. Thanks.

flaviocopes commented 7 years ago

Released