diff --git a/js/main.js b/js/main.js index 540541b..0f8de63 100644 --- a/js/main.js +++ b/js/main.js @@ -12,7 +12,7 @@ $(document).ready(function() { $("#filter_reset").on("click", function() { $("#form_filter").val(""); }); $("#panelimg").on("click", function() { updateImage(); }); $("#tab-tasks").on("click", function() { getTasks(); }); - //$("#tabs").on("tabsactivate", function(event, ui) { console.log($("#tabs").tabs('option', 'active')); }); + $("#tasklist").on("click", ".task", function() { editTask(this.dataset.id); }); getTasks(); let chartOptions = { chart: { @@ -212,7 +212,7 @@ function getTasks() { $("#form_showall").prop('checked', data.showalltasks); let show = ""; data.tasks.forEach(function(task, index) { - show += "
"; + show += "
"; show += "
Title: " + task.title_safe + "
"; show += "
Description: " + task.description_safe + "
"; show += "
Priority: " + task.priority + "
"; @@ -222,11 +222,6 @@ function getTasks() { show += "
"; }); $("#tasklist").html(show); - data.tasks.forEach(function(task, index) { - $("#task_"+task.id).click(function() { - editTask(task.id); - }); - }); }, error: function(jqo, stat, error) { toastr.error("Could not communicate with server!", "Server Error");