Improve task controller and fix bug description popover

This commit is contained in:
Frédéric Guillot
2014-09-01 21:10:27 -08:00
parent 457e181ffb
commit 7bb09c3f9b
9 changed files with 101 additions and 133 deletions

View File

@@ -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) {
$("body").append('<div id="popover-container"><div id="popover-content">' + content + '</div></div>');
$("#popover-container").click(function() {
$(this).remove();
});
$("#popover-content").click(function(e) {
e.stopPropagation();
});
if (callback) {
callback();
}
});
$("#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() {