diff options
author | Frédéric Guillot <fred@kanboard.net> | 2014-09-01 21:10:27 -0800 |
---|---|---|
committer | Frédéric Guillot <fred@kanboard.net> | 2014-09-01 21:10:27 -0800 |
commit | 7bb09c3f9b3440cf297104f32e80050601d61533 (patch) | |
tree | 3d5f2d014ffcabd3fd674d116ee1e3053aad527e /assets | |
parent | 457e181ffb915e36e5da77317a6c824e10f5d5b3 (diff) |
Improve task controller and fix bug description popover
Diffstat (limited to 'assets')
-rw-r--r-- | assets/js/app.js | 35 |
1 files changed, 23 insertions, 12 deletions
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('<div id="popover-container"><div id="popover-content">' + content + '</div></div>'); + 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('<div id="popover-container"><div id="popover-content">' + content + '</div></div>'); - 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() { |