Skip to content

Instantly share code, notes, and snippets.

@jerome-diver
Created September 10, 2016 07:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jerome-diver/d1505c26309819975d89a2cfe74970ab to your computer and use it in GitHub Desktop.
Save jerome-diver/d1505c26309819975d89a2cfe74970ab to your computer and use it in GitHub Desktop.
why rails-4 application doesn't care about delegate event for bind ajax ckeditor each time ?
// try it... but after the first call and cancel, the second call show that it serve nothing...
$(document).on('click', 'form[data-remote]', function(){
for (instance in CKEDITOR.instances){
CKEDITOR.instances[instance].updateElement(); } });
// try this... still doesn't change, still failed to load ckeditor on second call AJAX edition
$(document).on('ajax:before', 'form[data-remote]', function(){
for (instance in CKEDITOR.instances){
CKEDITOR.instances[instance].updateElement(); } });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment