activebridge / lazybox

Lazybox is a jQuery-based, simple, lightweight lightbox that can display entire remote pages, images and confirmation dialogs. Replace standard rails confirmations with lazybox just added several rows to your project.

Home Page:lazybox.herokuapp.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.