From 835e85b5ce9921ffd4d50b90b706e02685167331 Mon Sep 17 00:00:00 2001 From: Justin Nuß Date: Thu, 24 Jul 2014 22:31:59 +0200 Subject: Fix #281. Add mouse-over precise time and on-click switch listener. --- public/js/app.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'public/js/app.js') diff --git a/public/js/app.js b/public/js/app.js index 7ffcbd4a..cdc7d26b 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -960,6 +960,18 @@ function initOrganization() { console.log("init script : organization done"); } +function initTimeSwitch() { + $(".time-since[title]").on("click", function() { + var $this = $(this); + + var title = $this.attr("title"); + var text = $this.text(); + + $this.text(title); + $this.attr("title", text); + }); +} + (function ($) { $(function () { initCore(); @@ -988,6 +1000,8 @@ function initOrganization() { if ($('#body-nav').hasClass("org-nav")) { initOrganization(); } + + initTimeSwitch(); }); })(jQuery); -- cgit v1.2.3