Skip to content
This repository has been archived by the owner on Dec 14, 2021. It is now read-only.

Turbolinks Integration

Ahmet Sezgin DURAN edited this page Apr 8, 2016 · 1 revision

In order to use Medium Editor with Turbolinks, do the following:

  • Remove Medium Editor before the page loads.
  • Re-attach on page load. So:
var all_medium_editors = null;

$(document).on('turbolinks:before-render', function(){
    if(all_medium_editors != null) {
        all_medium_editors.destroy()
    }
})

$(document).on('turbolinks:load', function(){
    all_medium_editors = new MediumEditor('.editable', {
        // options go here
    });
})

Solution by rubentrf.

Clone this wiki locally