Adding spinner code breaks with JS error
jathayde opened this issue · comments
Lazybox works fine (Rails 5.1 app) with this in the application.js:
// Lazybox global call for popup light box
$(document).ready(function() {
$('a[rel*=lazybox]').lazybox({esc: true, close: true, modal: true, klass: 'class'});
});
Adding the spinner code from the read me throws Uncaught SyntaxError: Expected String
on the first line of that code:
$(document).on 'page:fetch', -> $.lazybox("<i class='fa fa-spinner fa-spin'>", { klass: 'spinner', close: false, esc: false })
$(document).on 'page:change', -> $.lazybox.close()
Do you add this to application.js? Because this is coffeescript
facepalm I need more sleep/coffee. Sorry for the stupid human trick.