From d88106c709e3d4de0b9edd858462aaf94dce2d1b Mon Sep 17 00:00:00 2001 From: Alisson Oliveira Souza Date: Mon, 3 Jul 2023 12:10:30 -0300 Subject: [PATCH] fix(google-cal): Fix button removing the edit button Closes toggl/track-extension-core#621 --- src/content/google-calendar.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/content/google-calendar.js b/src/content/google-calendar.js index 50a32b6e6..c959c1d19 100644 --- a/src/content/google-calendar.js +++ b/src/content/google-calendar.js @@ -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; } @@ -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); }