From f9067fe201edfeab3f994cdb2a80e93ce6fa57d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baz=C3=A1n?= Date: Fri, 4 Sep 2015 13:16:25 +0200 Subject: [PATCH] Fixes CKeditor & Turbolinks issue Closes #330 --- app/assets/javascripts/ckeditor/reinit.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 app/assets/javascripts/ckeditor/reinit.js diff --git a/app/assets/javascripts/ckeditor/reinit.js b/app/assets/javascripts/ckeditor/reinit.js new file mode 100644 index 000000000..fe8e8cff3 --- /dev/null +++ b/app/assets/javascripts/ckeditor/reinit.js @@ -0,0 +1,7 @@ +$(document).bind('page:change', function() { + if (typeof(CKEDITOR) != "undefined"){ + for(name in CKEDITOR.instances){ + try{CKEDITOR.replace(name);}catch(err){}; + } + } +}); \ No newline at end of file