Skip to content

Commit

Permalink
fix(rememberthemilk): Fix errors and conform to styleguide in Remembe…
Browse files Browse the repository at this point in the history
…rTheMilk
  • Loading branch information
tcrammond authored and shantanuraj committed May 24, 2019
1 parent cb5662c commit f269344
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/scripts/content/rememberthemilk.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,20 @@ togglbutton.render(
return p.textContent;
};

// Create and return toggl button's instance.
const createTogglButton = function () {
return togglbutton.createTimerLink({
const task = elem
.querySelector(
"div[role='listbox'] [role='option'] span[style*='user-select: text']"
);

if (task) {
const link = togglbutton.createTimerLink({
className: 'rememberthemilk',
description: getDescription,
projectName: getProject,
buttonType: 'minimal'
});
};

// Inject toggl button to each task.
elem
.querySelector(
"div[role='listbox'] [role='option'] span[style*='user-select: text']"
)
.parentElement.appendChild(createTogglButton());
task.parentElement.appendChild(link);
}
}
);
7 changes: 7 additions & 0 deletions src/styles/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,13 @@ li > .toggl-button.phabricator {
margin-left: 5px;
position: absolute;
}
.toggl-button.rememberthemilk:not(.active) {
display: none !important;
}

*:hover > .toggl-button.rememberthemilk {
display: inline-block !important;
}

/********* FRESHDESK *********/
.toggl-button.freshdesk {
Expand Down

0 comments on commit f269344

Please sign in to comment.