Added user-specific task list.

This commit is contained in:
2016-10-05 10:30:10 +02:00
parent 60c13615bf
commit 75e6b39069
7 changed files with 110 additions and 15 deletions

View File

@@ -15,15 +15,17 @@ function _remove_task_from_list(task_id) {
/**
* Open an item such as tasks/shots in the #item-details div
*/
function item_open(item_id, item_type, pushState)
function item_open(item_id, item_type, pushState, project_url)
{
if (item_id === undefined || item_type === undefined) {
throw new ReferenceError("item_open(" + item_id + ", " + item_type + ") called.");
}
var project_url = ProjectUtils.projectUrl();
if (typeof project_url === 'undefined') {
throw new ReferenceError("ProjectUtils.projectUrl() undefined");
project_url = ProjectUtils.projectUrl();
if (typeof project_url === 'undefined') {
throw new ReferenceError("ProjectUtils.projectUrl() undefined");
}
}
if ($(window).scrollTop() > 0) {
@@ -76,9 +78,10 @@ function item_open(item_id, item_type, pushState)
);
}
function task_open(task_id)
// Fine if project_url is undefined, but that requires ProjectUtils.projectUrl().
function task_open(task_id, project_url)
{
item_open(task_id, 'task');
item_open(task_id, 'task', true, project_url);
if (ProjectUtils.context() == 'shot'){
$('[id^="shot-"]').removeClass('active');
@@ -360,6 +363,7 @@ $(function() {
$("a.task-link[data-task-id]").click(function(e) {
e.preventDefault();
var task_id = e.delegateTarget.dataset.taskId;
task_open(task_id);
var project_url = e.delegateTarget.dataset.projectUrl; // fine if undefined
task_open(task_id, project_url);
});
});