lib/polyblock/capybara_helpers.rb in polyblock-0.9.7 vs lib/polyblock/capybara_helpers.rb in polyblock-0.9.8

- old
+ new

@@ -14,13 +14,15 @@ def fill_in_inline_polyblock(name, params={}) page.execute_script <<-SCRIPT var element = $('.polyblock[data-pbname="#{name}"]'); var ckeditor = CKEDITOR.instances[element.attr('id')]; - ckeditor.fire('focus'); - ckeditor.setData('#{params[:with]}'); - ckeditor.focus(); - ckeditor.updateElement(); + setTimeout(function(){ + ckeditor.fire('focus'); + ckeditor.setData('#{params[:with]}'); + ckeditor.focus(); + ckeditor.updateElement(); + }, 1); SCRIPT end end end