Skip to content

Commit

Permalink
fix(google-cal): Fix button removing the edit button
Browse files Browse the repository at this point in the history
  • Loading branch information
Alissonsz committed Jul 6, 2023
1 parent 3eebe96 commit d88106c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/content/google-calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ togglbutton.render(rootLevelSelectors, { observe: true }, elem => {
if (elemIsPopup) {
// Popup selector reaches here repeatedly, so we need to prevent the
// creation of more than one Toggl button for a popup view.
if ($('.toggl-button', elem)) {
if (elem.querySelector('.toggl-button')) {
return;
}

Expand Down Expand Up @@ -62,13 +62,15 @@ togglbutton.render(rootLevelSelectors, { observe: true }, elem => {
return;
}

const container = createTag('view', 'toggl-container');
const link = togglbutton.createTimerLink({
className: 'google-calendar-modern',
description: getDescription
});

if (elemIsPopup) {
target.prepend(link);
container.appendChild(link);
target.prepend(container);
} else if (elemIsDetail) {
target.appendChild(link);
}
Expand Down

0 comments on commit d88106c

Please sign in to comment.