diff --git a/src/scripts/tutti/10_tasks.js b/src/scripts/tutti/10_tasks.js index 1d9bcbb..89edfa7 100644 --- a/src/scripts/tutti/10_tasks.js +++ b/src/scripts/tutti/10_tasks.js @@ -12,6 +12,17 @@ function _remove_task_from_list(task_id) { }); } +/** + * Removes the 'active' class from any element whose ID starts with + * shot-, asset-, or task-. + */ +function deactivateItemLinks() +{ + $('[id^="shot-"]').removeClass('active'); + $('[id^="asset-"]').removeClass('active'); + $('[id^="task-"]').removeClass('active'); +} + /** * Open an item such as tasks/shots in the #item-details div */ @@ -31,7 +42,7 @@ function item_open(item_id, item_type, pushState, project_url) $('#col_right .col_header span.header_text').text(item_type + ' details'); // Style elements starting with item_type and dash, e.g. "#shot-uuid" - $('[id^="' + item_type + '-"]').removeClass('active'); + deactivateItemLinks(); $('#' + item_type + '-' + item_id).addClass('active'); // Special case to highlight the shot row when opening task in shot or asset context