mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
ui: fix reaction form (#602)
This commit is contained in:
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;
|
const canUseReaction = $('[data-op="react"]').length > 0;
|
||||||
$('[data-op="react"]').each((i, e) => {
|
$('[data-op="react"]').each((i, e) => {
|
||||||
ReactDOM.createRoot(e).render(
|
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) => {
|
$(document).on('click', '.reaction', async (e) => {
|
||||||
|
|||||||
@@ -108,7 +108,7 @@
|
|||||||
{{ action(_('Delete'), 'delete', 'comment', {operation: comment_delete_op, drid: doc._id}, 'delete') }}
|
{{ action(_('Delete'), 'delete', 'comment', {operation: comment_delete_op, drid: doc._id}, 'delete') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if (handler.user.hasPerm(perm.PERM_ADD_REACTION)) %}
|
{% 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 %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
<span class="icon icon-warning"></span> {{ _('Report') }}
|
<span class="icon icon-warning"></span> {{ _('Report') }}
|
||||||
</a></li>
|
</a></li>
|
||||||
{% if handler.user.hasPerm(perm.PERM_ADD_REACTION) %}
|
{% 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>
|
<span class="icon icon-emoji"></span>
|
||||||
</a></li>
|
</a></li>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|||||||
Reference in new issue
Block a user