Skip to content
Permalink
Browse files

Fix tinymce after message posting

Fixes #894
  • Loading branch information
nikolai-b committed Dec 13, 2019
1 parent 99bd437 commit 394a0ad028d9d740e4b81cb8a5629b2111262c92
Showing with 6 additions and 0 deletions.
  1. +6 −0 app/views/messages/created.js.erb
@@ -1,4 +1,5 @@
<% if @message.persisted? %>
tinyMCE.remove()
$('#messages-new-partial')
.before("<%= j(render 'messages/message', message: @message, thread: @thread ) %>")
.html("<%= j(render 'messages/new') %>")
@@ -10,6 +11,11 @@
el.scrollIntoView()
window.scrollBy(0, -80) // Top fix header
$(el).parent().addClass("new-message-highlight")
// Without a setTimeout tinyMCE has a bug where in initializes
// but it has no container so the editor is not selectable in FireFox.
setTimeout(function() {
tinyMCE.init(window.tinymceOpts)
}, 1)
<% end %>
<%= render 'shared/flash' %>
<% if flash[:alert].present? %>

0 comments on commit 394a0ad

Please sign in to comment.
You can’t perform that action at this time.