Skip to content

Commit 2390b7e

Browse files
committed
fix(trello): adjust selectors and debounce interval, and tweak css margins
Closes: #2275
1 parent 28a6719 commit 2390b7e

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

src/content/trello.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ const getProject = () => {
66
return project ? project.textContent.trim() : '';
77
};
88

9+
const cardContainerSelector = '.window-overlay .window-wrapper'
10+
911
togglbutton.render(
1012
'.window-header:not(.toggl)',
11-
{ observe: true },
13+
{ observe: true, debounceInterval: 300 },
1214
(elem) => {
1315
const actionButton =
1416
$('.js-move-card') ||
@@ -30,7 +32,7 @@ togglbutton.render(
3032
className: 'trello',
3133
description: getDescription,
3234
projectName: getProject,
33-
container: '.window-wrapper'
35+
container: cardContainerSelector
3436
});
3537

3638
// Pass through click on Trello button to the timer link
@@ -42,7 +44,7 @@ togglbutton.render(
4244
container.appendChild(link);
4345
actionButton.parentNode.insertBefore(container, actionButton);
4446
},
45-
'.window-wrapper'
47+
cardContainerSelector
4648
);
4749

4850
/* Checklist buttons */
@@ -69,15 +71,14 @@ togglbutton.render(
6971
buttonType: 'minimal',
7072
projectName: getProject,
7173
description: getDescription,
72-
container: '.window-wrapper'
74+
container: cardContainerSelector
7375
});
7476
const wrapper = document.createElement('span');
7577
wrapper.classList.add('checklist-item-menu');
7678
wrapper.style.display = 'flex';
7779
wrapper.style.alignItems = 'center';
78-
wrapper.style.marginRight = '4px';
7980
wrapper.appendChild(link);
8081
elem.querySelector('.checklist-item-controls').appendChild(wrapper);
8182
},
82-
'.checklist-items-list, .window-wrapper'
83+
`.checklist-items-list, ${cardContainerSelector}`
8384
);

src/styles/style.css

+2
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,8 @@ SingleTaskPaneToolbar .toggl-button.asana-board, /* new ui v1 */
175175
.toggl-button.trello-list:not(.toggl-button-edit-form-button) {
176176
visibility: hidden;
177177
pointer-events: none;
178+
margin-top: 6px;
179+
margin-left: 1px;
178180
}
179181
.checklist-item-details:hover .toggl-button.trello-list, .toggl-button.trello-list.active:not(.toggl-button-edit-form-button) {
180182
visibility: visible;

0 commit comments

Comments
 (0)