We didn't upgrade Turbolinks when we upgraded to Rails 5 so we didn't upgrade too many things at the same time, and postponed it... until now :). Note upgrading Turbolinks fixes an issue with foundation's sticky when using the browser's back and forward buttons. We're adding tests for these scenarios. Co-authored-by: Senén Rodero Rodríguez <senenrodero@gmail.com>
22 lines
617 B
JavaScript
22 lines
617 B
JavaScript
(function() {
|
|
"use strict";
|
|
App.HTMLEditor = {
|
|
destroy: function() {
|
|
for (var name in CKEDITOR.instances) {
|
|
CKEDITOR.instances[name].destroy();
|
|
}
|
|
},
|
|
initialize: function() {
|
|
$("textarea.html-area").each(function() {
|
|
if ($(this).hasClass("admin")) {
|
|
CKEDITOR.replace(this.name, { language: $("html").attr("lang"), toolbar: "admin", height: 500 });
|
|
} else {
|
|
CKEDITOR.replace(this.name, { language: $("html").attr("lang") });
|
|
}
|
|
});
|
|
}
|
|
};
|
|
|
|
$(document).on("turbolinks:before-cache", App.HTMLEditor.destroy);
|
|
}).call(this);
|