Skip to content

Commit

Permalink
fix(Xero): Fix showing Toggl Button in Xero (#2022)
Browse files Browse the repository at this point in the history
* fix(Xero): Fix showing Toggl Button in Xero

* Update origins.js
  • Loading branch information
EternallLight authored Jan 24, 2022
1 parent c24a7fe commit 2271678
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
15 changes: 10 additions & 5 deletions src/content/xero.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
/**
* @name Xero
* @urlAlias xero.com
* @urlRegex '*://*.xero.com/*'
*/
'use strict';

togglbutton.render('.xrh-header--main:not(.toggl)', {}, function (elem) {
const container = $('.xrh-addons');
togglbutton.render('.xnav-header--main:not(.toggl)', {}, function (elem) {
const container = $('.xnav-addons');
let descriptionNode;

if ($('#page_title h1')) {
Expand Down Expand Up @@ -50,7 +55,7 @@ togglbutton.render('.xrh-header--main:not(.toggl)', {}, function (elem) {
const div = createTag('div', 'xrh-focusable--child xrh-iconwrapper');
div.appendChild(link);

const button = createTag('button', 'xrh-button xrh-addon--iconbutton xrh-header--iconbutton xrh-focusable--parent');
const button = createTag('button', 'xnav-header-button xnav-addon--iconbutton xnav-header--iconbutton xnav-focusable--parent');
button.type = 'button';

button.addEventListener('click', function (e) {
Expand All @@ -60,11 +65,11 @@ togglbutton.render('.xrh-header--main:not(.toggl)', {}, function (elem) {

button.appendChild(div);

const liTag = createTag('li', 'xrh-addon');
const liTag = createTag('li', 'xnav-addon');
liTag.appendChild(button);

if (container) {
const userIcon = $('[data-automationid="xrh-addon-user"]', container);
const userIcon = $('[data-automationid="xnav-addon-user"]', container);
container.insertBefore(liTag, userIcon);
}
});
5 changes: 3 additions & 2 deletions src/origins.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,8 +720,9 @@ export default {
name: 'Wunderlist'
},
'xero.com': {
url: '*://*.xero.com/*',
name: 'Xero'
url: ''*://*.xero.com/*'',
name: 'Xero',
file: 'xero.js'
},
'myjetbrains.com': {
url: '*://*.myjetbrains.com/*',
Expand Down

0 comments on commit 2271678

Please sign in to comment.