ParitoshBh / grav-coder

https://paritoshbh.me
MIT License
28 stars 8 forks source link

Featherlight plugin doesn't seem to work in this theme #13

Closed Japhys closed 5 years ago

Japhys commented 5 years ago

Hi there,

I have been struggling to get featherlight lightbox plugin to work in this theme but I couldn't figure out why it didn't work. In the end I did a clean installation of Grav, tried te plugin in the default theme, installed Grav code, tried plugin again and it failed. Could you please look into this? I really need it and I would love to keep using this theme.

Kind regards

Japhys commented 5 years ago

I checked in Chrome dev tools

Uncaught TypeError: c.$instance.fadeIn is not a function
    at b.open (featherlight.min.js:8)
    at HTMLAnchorElement.i (featherlight.min.js:8)
    at HTMLAnchorElement.dispatch (jquery-slim.min.js:2)
    at HTMLAnchorElement.v.handle (jquery-slim.min.js:2)
open @ featherlight.min.js:8
i @ featherlight.min.js:8
dispatch @ jquery-slim.min.js:2
v.handle @ jquery-slim.min.js:2

So I replaced the slim for the full version and then it worked

ParitoshBh commented 5 years ago

Glad it worked! And for those who might face similar issue in future, please note that,

  1. This theme uses jQuery slim version which strips out a lot of functionality (not used by theme) including one of the functions used by featherlight plugin.
  2. As of 3rd June, 2019, jQuery verison 3.3.1 was being used. The full version can be obtained from here.
  3. By adding full version, you'll be adding ~20KB to page size.