Custom JS for Asana
Use the following snippets of Javascript to create bookmarklets for Asana that give you additional features their developers are too busy (making appreciations) to implement themselves.
Add each bookmarklet as each one has its own use case in a workflow.
Collapse All Sections & Subtasks
javascript:(function(){document.querySelectorAll('.SpreadsheetTaskRow-nameCell .DownTriangleIcon').forEach(function(element){ element.parentNode.click() })}());javascript:(function(){document.querySelectorAll('.TaskGroupHeader-toggleButton .DownTriangleIcon').forEach(function(element){ element.parentNode.click() })}());
Expand All Sections & Subtasks
javascript:(function(){document.querySelectorAll('.TaskGroupHeader-toggleButton .RightTriangleIcon').forEach(function(element){ element.parentNode.click() })}());javascript:(function(){document.querySelectorAll('.SpreadsheetTaskRow-nameCell .RightTriangleIcon').forEach(function(element){ element.parentNode.click() })}());javascript:(function () { var count = 20; var ival = window.setInterval(() => { count--; if(count <= 0){ window.clearInterval(ival); } let links = document.querySelectorAll('.SpreadsheetTaskList-showMoreLink'); if(links.length === 0){ return; } Array.from(links).map((link) => { link.click(); }); }, 400);})();
Collapse All Sections
javascript:(function(){document.querySelectorAll('.TaskGroupHeader-toggleButton .DownTriangleIcon').forEach(function(element){ element.parentNode.click() })}());
Expand All Sections
javascript:(function(){document.querySelectorAll('.TaskGroupHeader-toggleButton .RightTriangleIcon').forEach(function(element){ element.parentNode.click() })}());
Collapse All Subtasks
javascript:(function(){document.querySelectorAll('.SpreadsheetTaskRow-nameCell .DownTriangleIcon').forEach(function(element){ element.parentNode.click() })}());
Expand All Subtasks
javascript:(function(){document.querySelectorAll('.SpreadsheetTaskRow-nameCell .RightTriangleIcon').forEach(function(element){ element.parentNode.click() })}());javascript:(function () { var count = 20; var ival = window.setInterval(() => { count--; if(count <= 0){ window.clearInterval(ival); } let links = document.querySelectorAll('.SpreadsheetTaskList-showMoreLink'); if(links.length === 0){ return; } Array.from(links).map((link) => { link.click(); }); }, 400);})();