Skip to content

Commit aa3bc6f

Browse files
authored
fix(trello): adjust selectors and debounce interval, and tweak margins (#2276)
Closes: #2275 * chore(trello): add trello.js metadata * Update origins.js
1 parent 28a6719 commit aa3bc6f

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

src/content/trello.js

+12-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* @name Trello
3+
* @urlAlias trello.com
4+
* @urlRegex *://trello.com/*
5+
*/
16
'use strict';
27
/* global createTag */
38

@@ -6,9 +11,11 @@ const getProject = () => {
611
return project ? project.textContent.trim() : '';
712
};
813

14+
const cardContainerSelector = '.window-overlay .window-wrapper'
15+
916
togglbutton.render(
1017
'.window-header:not(.toggl)',
11-
{ observe: true },
18+
{ observe: true, debounceInterval: 300 },
1219
(elem) => {
1320
const actionButton =
1421
$('.js-move-card') ||
@@ -30,7 +37,7 @@ togglbutton.render(
3037
className: 'trello',
3138
description: getDescription,
3239
projectName: getProject,
33-
container: '.window-wrapper'
40+
container: cardContainerSelector
3441
});
3542

3643
// Pass through click on Trello button to the timer link
@@ -42,7 +49,7 @@ togglbutton.render(
4249
container.appendChild(link);
4350
actionButton.parentNode.insertBefore(container, actionButton);
4451
},
45-
'.window-wrapper'
52+
cardContainerSelector
4653
);
4754

4855
/* Checklist buttons */
@@ -69,15 +76,14 @@ togglbutton.render(
6976
buttonType: 'minimal',
7077
projectName: getProject,
7178
description: getDescription,
72-
container: '.window-wrapper'
79+
container: cardContainerSelector
7380
});
7481
const wrapper = document.createElement('span');
7582
wrapper.classList.add('checklist-item-menu');
7683
wrapper.style.display = 'flex';
7784
wrapper.style.alignItems = 'center';
78-
wrapper.style.marginRight = '4px';
7985
wrapper.appendChild(link);
8086
elem.querySelector('.checklist-item-controls').appendChild(wrapper);
8187
},
82-
'.checklist-items-list, .window-wrapper'
88+
`.checklist-items-list, ${cardContainerSelector}`
8389
);

src/origins.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,9 @@ export default {
594594
clone: 'true'
595595
},
596596
'trello.com': {
597-
url: '*://*.trello.com/*',
598-
name: 'Trello'
597+
url: '*://trello.com/*',
598+
name: 'Trello',
599+
file: 'trello.js'
599600
},
600601
'unfuddle.com': {
601602
url: '*://*.unfuddle.com/*',

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)