So I am using this rails gem: https://github.com/kyparn/fancybox2-rails
- Using BackboneJS for frontend and instantiating fancybox in the View
Fancybox works perfectly locally but on staging and production, images are opened in a new window. I checked chrome console and made sure that fancybox was present, and it is.
Not entirely sure how to resolve this / go about debugging this.
This is how I have images setup:
<a class="fancybox-image" data-fancybox="image" href="image_url">
<img src="image_url" data-js="activate-img-modal">
</a>
I am instantiating fancybox setup in the Backbone View where each image is in.
setupFancyBox: function() {
var options = {
helpers: {
overlay: {
locked: false
}
}
};
this.$("[data-fancybox='image']").fancybox(options);
}
- This function is called in the View's render method.