ui: fix reaction form (#602)

This commit is contained in:
panda authored and GitHub committed 2023-07-01 20:18:51 +08:00
1 parent f2990d87a6
commit 449ee8c708
3 files changed
+3 -3

No files matched your search

@@ -68,7 +68,7 @@ const reactionPage = new AutoloadPage('reactionPage', () => {
const canUseReaction = $('[data-op="react"]').length > 0;
$('[data-op="react"]').each((i, e) => {
ReactDOM.createRoot(e).render(
<Reaction payload={$(e).data('form')} ele={$(`.reactions[data-${$(e).data('form').type}='${$(e).data('form').id}']`)} />,
<Reaction payload={$(e).data('form')} ele={$(`.reactions[data-${$(e).data('form').nodeType}='${$(e).data('form').id}']`)} />,
);
});
$(document).on('click', '.reaction', async (e) => {
@@ -108,7 +108,7 @@
{{ action(_('Delete'), 'delete', 'comment', {operation: comment_delete_op, drid: doc._id}, 'delete') }}
{% endif %}
{% if (handler.user.hasPerm(perm.PERM_ADD_REACTION)) %}
{{ action('', 'react', 'comment', {operation: 'reaction', type:'drid', id: doc._id}, 'emoji') }}
{{ action('', 'react', 'comment', {operation: 'reaction', nodeType: 'drid', id: doc._id}, 'emoji') }}
{% endif %}
</div>
</div>
@@ -62,7 +62,7 @@
<span class="icon icon-warning"></span> {{ _('Report') }}
</a></li>
{% if handler.user.hasPerm(perm.PERM_ADD_REACTION) %}
<li><a href="javascript:;" data-op="react" data-type="discuss" data-form="{{ {operation: 'reaction', type:'did', id: ddoc._id }|json }}">
<li><a href="javascript:;" data-op="react" data-type="discuss" data-form="{{ {operation: 'reaction', nodeType:'did', id: ddoc._id }|json }}">
<span class="icon icon-emoji"></span>
</a></li>
{% endif %}