Skip to content

Commit

Permalink
fix(trello): make the side button work again
Browse files Browse the repository at this point in the history
  • Loading branch information
askides committed Sep 26, 2024
1 parent 1ed1a4c commit a1fe3fe
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions src/content/trello.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -47,7 +49,8 @@ togglbutton.render(
})

container.appendChild(link)
actionButton.parentNode.insertBefore(container, actionButton)

actionsWrapper.prepend(container)
},
cardContainerSelector,
)
Expand Down

0 comments on commit a1fe3fe

Please sign in to comment.