diff options
author | dartcafe <github@dartcafe.de> | 2017-11-11 12:14:34 +0300 |
---|---|---|
committer | dartcafe <github@dartcafe.de> | 2017-11-11 12:14:34 +0300 |
commit | 24b562968e3f8228cc8483eb913e5a72eeb9c1f3 (patch) | |
tree | f2eda7f00deade1cefb39701644369a06556f1af /js | |
parent | 61f7d54f1e01d858a75fb674862c101d58518667 (diff) |
updated sidebar
Diffstat (limited to 'js')
-rw-r--r-- | js/vote.js | 19 |
1 files changed, 14 insertions, 5 deletions
@@ -13,7 +13,6 @@ $.fn.switchClass = function (a, b) { }; function updateCommentsCount() { - // TODO: Update the Badgecounter $('#comment-counter').removeClass('no-comments'); $('#comment-counter').text(parseInt($('#comment-counter').text()) +1); @@ -54,7 +53,6 @@ function switchSidebar() { } } - $(document).ready(function () { // count how many times in each date new Clipboard('.copy-link'); @@ -71,7 +69,7 @@ $(document).ready(function () { OC.Apps.hideAppSidebar(); }); - $('.poll.avatardiv').each(function (i, obj) { + $('.avatar').each(function (i, obj) { $(obj).avatar(obj.title, 32); }); @@ -144,8 +142,18 @@ $(document).ready(function () { commentBox: comment.value.trim() }; $('.new-comment .icon-loading-small').show(); - $.post(form.action, data, function (data) { - $('.comments .comment:first').after('<div class="comment"><div class="comment-header"><span class="comment-date">' + data.date + '</span>' + data.userName + '</div><div class="wordwrap comment-content">' + data.comment + '</div></div>'); + $.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="author">' + data.userName + '</div>' + + '<div class="date has-tooltip live-relative-timestamp datespan" data-timestamp="' + Date.now() + '" title="' + data.date + '">' + t('now') + '</div>' + + '</div>' + + '<div class="message wordwrap comment-content">' + data.comment + '</div>' + + '</li>'; + + + $('.comments .comment:first').before(newCommentElement); $('.new-comment textarea').val('').focus(); $('.new-comment .icon-loading-small').hide(); updateCommentsCount(); @@ -162,6 +170,7 @@ $(document).ready(function () { $('.toggle-cell').tooltip(); $('.time-slot').tooltip(); $('.avatardiv').tooltip(); + $('.has-tooltip').tooltip(); updateCounters(); }); |