Skip to content

Commit

Permalink
fix(teamwork): Update CSS selectors for teamwork Desk (#2051)
Browse files Browse the repository at this point in the history
* fix(teamwork): Update CSS selectors for teamwork Desk

* chore(teamwork): Update teamwork content header

* Update origins.js
  • Loading branch information
tiberiusuciu authored Mar 7, 2022
1 parent 939bbd8 commit f463f04
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
32 changes: 32 additions & 0 deletions src/content/teamwork.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/**
* @name Teamwork
* @urlAlias teamwork.com
* @urlRegex *://*.teamwork.com/*
*/

'use strict';

// Tasks listing page in project
Expand Down Expand Up @@ -174,3 +180,29 @@ togglbutton.render(
root.appendChild(link);
}
);

// Teamwork Desk - new design (March 2022)
togglbutton.render(
'.ticket-view-page--container:not(.toggl)',
{ observe: true },
function (elem) {
// ticket view
const container = $('.title-container', elem);
const id = $('.ticket-id', elem).textContent;
const description = $('.title__subject', elem).textContent;

const descFunc = function () {
return id.trim() + ' ' + description.trim();
};

const link = togglbutton.createTimerLink({
className: 'teamwork',
buttonType: 'minimal',
description: descFunc
});

link.style.margin = '3px 0 0 7px';

container.appendChild(link);
}
);
3 changes: 2 additions & 1 deletion src/origins.js
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,8 @@ export default {
},
'teamwork.com': {
url: '*://*.teamwork.com/*',
name: 'Teamwork'
name: 'Teamwork',
file: 'teamwork.js'
},
'teamworkpm.net': {
url: '*://*.teamworkpm.net/*',
Expand Down

0 comments on commit f463f04

Please sign in to comment.