diff --git a/src/content/trello.js b/src/content/trello.js index f18f2a784..4851b9b0c 100644 --- a/src/content/trello.js +++ b/src/content/trello.js @@ -13,27 +13,29 @@ const getProject = () => { return project ? project.textContent.trim() : '' } -const cardContainerSelector = '.card-detail-window' +const cardContainerSelector = '.window-wrapper' + togglbutton.render( - '.window-header:not(.toggl)', - { observe: true, debounceInterval: 300 }, + '#card-back-name:not(.toggl)', + { observe: true, debounceInterval: 1000 }, (elem) => { - const actionButton = - $('.js-move-card') || - $('.js-copy-card') || - $('.js-archive-card') || - $('.js-more-menu') + const actionsWrapper = $( + '#layer-manager-card-back section:nth-child(4) > ul', + ) + + console.log('NewActionButton:', actionsWrapper) - if (!actionButton) { + if (!actionsWrapper) { return } const getDescription = () => { - const description = $('.window-title h2', elem) + const description = $('#card-back-name') return description ? description.textContent.trim() : '' } const container = createTag('div', 'button-link trello-tb-wrapper') + const link = togglbutton.createTimerLink({ className: 'trello', description: getDescription, @@ -47,7 +49,8 @@ togglbutton.render( }) container.appendChild(link) - actionButton.parentNode.insertBefore(container, actionButton) + + actionsWrapper.prepend(container) }, cardContainerSelector, )