Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/polls.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authordartcafe <github@dartcafe.de>2017-11-11 17:47:10 +0300
committerdartcafe <github@dartcafe.de>2017-11-11 17:47:10 +0300
commit8eb9f37d69936168585b57cf656b07d5593692b7 (patch)
tree3b1e7b16ff1de51859f038d642fb5fcfee2929e8 /js
parentf7e85f29aefaef8270de7ac4cf51e61c4c77ed4d (diff)
add avatar to new comment
A quick fix.
Diffstat (limited to 'js')
-rw-r--r--js/vote.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/js/vote.js b/js/vote.js
index be9c8963..5e94f50e 100644
--- a/js/vote.js
+++ b/js/vote.js
@@ -145,7 +145,7 @@ $(document).ready(function () {
$.post(form.action, data, function(data) {
var newCommentElement = '<li class="comment column"> ' +
'<div class="authorRow user-cell row"> ' +
- '<div class="avatar avatardiv" title="' + data.userId + '"></div> ' +
+ '<div class="avatar missing" title="' + data.userId + '"></div> ' +
'<div class="author">' + data.userName + '</div>' +
'<div class="date has-tooltip live-relative-timestamp datespan" data-timestamp="' + Date.now() + '" title="' + data.date + '">' + t('now') + '</div>' +
'</div>' +
@@ -156,6 +156,12 @@ $(document).ready(function () {
$('.comments .comment:first').before(newCommentElement);
$('.new-comment textarea').val('').focus();
$('.new-comment .icon-loading-small').hide();
+
+ $('.avatar.missing').each(function (i, obj) {
+ $(obj).avatar(obj.title, 32);
+ $(obj).removeClass('missing');
+ });
+
updateCommentsCount();
}).error(function () {
alert(t('polls', 'An error occurred, your comment was not posted.'));