Skip to content

Support Turbolinks 5 #208

Open
Open
@btrewern

Description

@btrewern

Hi, I was hoping you could support Turbolinks 5.

I think I've found what code needs to be changed but don't do much Javascript and don't understand how this code is packaged.

I think what needs to be changed is here in index.js:

if (typeof global.Turbolinks == 'object') {
  global.document.addEventListener('page:change', function() {
    Holder.run();
  });
}

to

if (typeof global.Turbolinks.controller == 'object') { // Turbolinks 5
  global.document.addEventListener('turbolinks:load', function() {
    Holder.run();
  });
} else if (typeof global.Turbolinks == 'object') { // Turbolinks Classic
  global.document.addEventListener('page:change', function() {
    Holder.run();
  });
}

I hope this makes sense.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions