-
Notifications
You must be signed in to change notification settings - Fork 569
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add new integration for next generation of LiquidPlanner for #2205
- Loading branch information
1 parent
f5d858b
commit b3406f7
Showing
2 changed files
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
'use strict'; | ||
|
||
// Main function | ||
togglbutton.render( | ||
// Specify selector for element button needs to hook into | ||
// Make sure to include :not(.toggl) to avoid duplicates | ||
'.lp-item-panel__header-actions:not(.toggl)', | ||
{ observe: true }, | ||
function (elem) { | ||
const taskDescription = document.querySelector(".breadcrumb > a").textContent; | ||
const projectName = document.querySelector(".breadcrumb :nth-child(3)").textContent.slice(0, -1); // slice to remove trailing forward slash | ||
|
||
// Create timer link element | ||
const link = togglbutton.createTimerLink({ | ||
description: taskDescription, | ||
buttonType: 'minimal', // button type, if skipped will render full size | ||
projectName: projectName, | ||
}); | ||
|
||
// Add link to element | ||
elem.append(link); | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters