comparison src/save_edit.js.luan @ 19:da006d1c1eba

use contentEditable
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 13 Jul 2022 08:47:13 -0600
parents bff178656073
children 33731231093a
comparison
equal deleted inserted replaced
18:94e26bffd4fb 19:da006d1c1eba
23 post.save() 23 post.save()
24 end ) 24 end )
25 local html = output_of(function() bbcode_to_html(post.content) end) 25 local html = output_of(function() bbcode_to_html(post.content) end)
26 Io.stdout = Http.response.text_writer() 26 Io.stdout = Http.response.text_writer()
27 %> 27 %>
28 cancelEdit('<%=post.id%>');
29 let postDiv = document.querySelector('[post="<%=post.id%>"]'); 28 let postDiv = document.querySelector('[post="<%=post.id%>"]');
29 cancelEdit(postDiv);
30 postDiv.querySelector('[message]').innerHTML = <%= json_string(html) %>; 30 postDiv.querySelector('[message]').innerHTML = <%= json_string(html) %>;
31 <% 31 <%
32 end 32 end