Skip to content

Commit

Permalink
fix(azure): Fix button now showing up in the new UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Alissonsz committed Jul 5, 2023
1 parent 54cfcec commit c2a7cf2
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/content/visualstudio.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,24 @@ togglbutton.render(
}
}
);

togglbutton.render(
'.work-item-form-header:not(.toggl)',
{ observe: true },
function () {
const activeButtonContainer = $('.work-item-header-command-bar')?.firstChild;
const description = $('.work-item-title-textfield input')?.value
const itemId = $('.work-item-form-header')?.children[1]?.textContent

const link = togglbutton.createTimerLink({
className: 'visual-studio-online',
description: `${itemId ? itemId + ' ' : ''}${description}`,
projectName: projectSelector,
container: '.work-item-header-command-bar'
});

const wrapper = createTag('menu-item');
wrapper.appendChild(link);
activeButtonContainer.prepend(wrapper);
}
);

0 comments on commit c2a7cf2

Please sign in to comment.