diff --git a/less/topic.less b/less/topic.less index c7c0119..0152acc 100644 --- a/less/topic.less +++ b/less/topic.less @@ -214,7 +214,7 @@ > li { position: relative; - .status { + .edit-icon, .status { vertical-align: -2%; } diff --git a/lib/persona.js b/lib/persona.js index 389c624..1d9a898 100644 --- a/lib/persona.js +++ b/lib/persona.js @@ -4,6 +4,7 @@ $(document).ready(function() { setupSlideMenu(); + setupEditedByIcon(); var env = utils.findBootstrapEnvironment(); @@ -75,7 +76,6 @@ $(document).ready(function() { } }); - function createChatIcon(data) { data.options.icon = 'fa-spinner fa-spin'; @@ -92,5 +92,31 @@ $(document).ready(function() { } } + function setupEditedByIcon() { + function activateEditedTooltips() { + $('[data-pid] [component="post/editor"]').each(function() { + var el = $(this); + + if (!el.attr('data-editor')) { + return; + } + + icon = el.parents('[data-pid]').find('.edit-icon'); + icon.prop('title', el.text()).tooltip('fixTitle').removeClass('hidden'); + }); + } + + $(window).on('action:posts.edited', function(ev, data) { + var parent = $('[data-pid="' + data.post.pid + '"]'), + icon = parent.find('.edit-icon'), + el = parent.find('[component="post/editor"]'); + + icon.prop('title', el.text()).tooltip('fixTitle').removeClass('hidden'); + }); + + $(window).on('action:topic.loaded', activateEditedTooltips); + $(window).on('action:posts.loaded', activateEditedTooltips); + } + }); \ No newline at end of file diff --git a/templates/partials/topic/post-editor.tpl b/templates/partials/topic/post-editor.tpl index 23ba202..df96bb8 100644 --- a/templates/partials/topic/post-editor.tpl +++ b/templates/partials/topic/post-editor.tpl @@ -1 +1 @@ -[[global:last_edited_by_ago, {editor.username}, ]] \ No newline at end of file + \ No newline at end of file diff --git a/templates/partials/topic/post.tpl b/templates/partials/topic/post.tpl index 8ff45a4..f917b45 100644 --- a/templates/partials/topic/post.tpl +++ b/templates/partials/topic/post.tpl @@ -18,6 +18,7 @@
[[global:posted_ago, ]] + [[topic:reply]] @@ -59,7 +60,7 @@
-[[global:last_edited_by_ago, {posts.editor.username}, ]] +