Skip to content

Commit

Permalink
Update app.js
Browse files Browse the repository at this point in the history
  • Loading branch information
husseinalhammad committed Feb 20, 2021
1 parent b3c8432 commit c89ab48
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions pipit_members/js/app.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
window.addEventListener('load', (event) => {
const pageUrl = window.location.pathname.replace(/\/+$/, "");
let icon = '';
try {
icon = Perch.UI.Helpers.icon('ext/o-cloud-download', 14)
} catch (e) {
// could not use Perch.UI.Helpers.icon()
}


console.log(Perch.UI.Helpers)
console.log(`${Perch.path}/addons/apps/perch_members`)

if (pageUrl == `${Perch.path}/addons/apps/perch_members`) {
let smartbar = document.querySelector('.smartbar ul');

smartbar.insertAdjacentHTML('beforeend', `
document.querySelector('.smartbar ul').insertAdjacentHTML('beforeend', `
<li class="smartbar-end smartbar-util">
<a href="${Perch.path}/addons/apps/pipit_members/export/" title="Download CSV">
${Perch.UI.Helpers.icon('ext/o-cloud-download', 14)}
<span>Download CSV</span>
${icon}<span>Download CSV</span>
</a>
</li>
`);

}
});

0 comments on commit c89ab48

Please sign in to comment.