Add toggle button to show/hide subtasks in task list view

This commit is contained in:
Frederic Guillot
2017-02-26 19:30:02 -05:00
parent 4f325193be
commit f3deb6492a
28 changed files with 257 additions and 89 deletions

View File

@@ -6,7 +6,7 @@ Kanboard.Subtask.prototype.listen = function() {
var self = this;
this.dragAndDrop();
$(document).on("click", ".subtask-toggle-status", function(e) {
$(document).on("click", ".js-subtask-toggle-status", function(e) {
var el = $(this);
e.preventDefault();
@@ -14,18 +14,12 @@ Kanboard.Subtask.prototype.listen = function() {
cache: false,
url: el.attr("href"),
success: function(data) {
if (el.hasClass("subtask-refresh-table")) {
$(".subtasks-table").replaceWith(data);
} else {
el.replaceWith(data);
}
self.dragAndDrop();
$(el).closest('.subtask-title').replaceWith(data);
}
});
});
$(document).on("click", ".subtask-toggle-timer", function(e) {
$(document).on("click", ".js-subtask-toggle-timer", function(e) {
var el = $(this);
e.preventDefault();
@@ -33,8 +27,7 @@ Kanboard.Subtask.prototype.listen = function() {
cache: false,
url: el.attr("href"),
success: function(data) {
$(".subtasks-table").replaceWith(data);
self.dragAndDrop();
$(el).closest('.subtask-time-tracking').replaceWith(data);
}
});
});