1
0
Fork 0
forked from mirror/pixelfed

Update commentform component

This commit is contained in:
Daniel Supernault 2018-08-09 21:54:12 -06:00
parent 5a9fb29c17
commit 03f4c23024
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -1,6 +1,12 @@
$(document).ready(function() {
$('.status-comment-focus').on('click', function(el) {
$('.status-card > .card-footer').each(function() {
$(this).addClass('d-none');
});
$(document).on('click', '.status-comment-focus', function(el) {
var form = $(this).parents().eq(2).find('.card-footer');
form.removeClass('d-none');
var el = $(this).parents().eq(2).find('input[name="comment"]');
el.focus();
});
@ -31,7 +37,7 @@ $(document).ready(function() {
var comment = '<p class="mb-0"><span class="font-weight-bold pr-1"><bdi><a class="text-dark" href="' + profile + '">' + username + '</a></bdi></span><span class="comment-text">'+ reply + '</span><span class="float-right"><a href="' + permalink + '" class="text-dark small font-weight-bold">1s</a></span></p>';
comments.prepend(comment);
comments.append(comment);
commentform.val('');
commentform.blur();
@ -41,7 +47,5 @@ $(document).ready(function() {
.catch(function (res) {
});
});
});