fluidbox-ghost-blog-plugin
fluidbox-ghost-blog-plugin copied to clipboard
Warnings on public method close
I'm getting a tons of warning when scrolling my posts with fluidbox on my ghost instance.
Fluidbox: The method "close" used is not defined in Fluidbox. Please make sure you are calling the correct public method.
It seems to come from this line, when we close after scrolling some pixels. The current selector select even elements that haven't been initialized by fluidbox
if (Math.abs(currentScrollPosition - scrollPosition) > 60)
$('a').fluidbox('close');
Solution
if (Math.abs(currentScrollPosition - scrollPosition) > 60)
$('a.fluidbox--opened').fluidbox('close');
Selecting & closing opened element is doing the trick, I'm gonna submit a PR