From 7bb09c3f9b3440cf297104f32e80050601d61533 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Mon, 1 Sep 2014 21:10:27 -0800 Subject: Improve task controller and fix bug description popover --- assets/js/app.js | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'assets/js') diff --git a/assets/js/app.js b/assets/js/app.js index 20af61eb..68da5fcb 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -9,22 +9,30 @@ var Kanboard = (function() { e.preventDefault(); e.stopPropagation(); - $.get(e.target.getAttribute("href"), function(content) { + var link = e.target.getAttribute("href"); - $("body").append('
' + content + '
'); + if (! link) { + link = e.target.getAttribute("data-href"); + } - $("#popover-container").click(function() { - $(this).remove(); - }); + if (link) { + $.get(link, function(content) { - $("#popover-content").click(function(e) { - e.stopPropagation(); - }); + $("body").append('
' + content + '
'); - if (callback) { - callback(); - } - }); + $("#popover-container").click(function() { + $(this).remove(); + }); + + $("#popover-content").click(function(e) { + e.stopPropagation(); + }); + + if (callback) { + callback(); + } + }); + } }, // Return true if the page is visible @@ -89,6 +97,9 @@ Kanboard.Board = (function() { Kanboard.Popover(e, Kanboard.Task.Init); }); + // Description popover + $(".task-description-popover").click(Kanboard.Popover); + // Redirect to the task details page $("[data-task-id]").each(function() { $(this).click(function() { -- cgit v1.2.3