2020-09-28 15:09:44 +00:00
|
|
|
import Vue from 'vue';
|
|
|
|
import InviteMembersTrigger from '~/invite_members/components/invite_members_trigger.vue';
|
|
|
|
|
|
|
|
export default function initInviteMembersTrigger() {
|
2021-05-27 12:10:56 +00:00
|
|
|
const triggers = document.querySelectorAll('.js-invite-members-trigger');
|
2020-09-28 15:09:44 +00:00
|
|
|
|
2021-05-27 12:10:56 +00:00
|
|
|
if (!triggers) {
|
2020-09-28 15:09:44 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2021-05-27 12:10:56 +00:00
|
|
|
return triggers.forEach((el) => {
|
|
|
|
return new Vue({
|
|
|
|
el,
|
|
|
|
render: (createElement) =>
|
|
|
|
createElement(InviteMembersTrigger, {
|
|
|
|
props: {
|
|
|
|
...el.dataset,
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
});
|
2020-09-28 15:09:44 +00:00
|
|
|
});
|
|
|
|
}
|