-
Notifications
You must be signed in to change notification settings - Fork 0
/
pg-custel.js
34 lines (34 loc) · 1.18 KB
/
pg-custel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import { AbsSlotCustel } from 'https://cdn.jsdelivr.net/gh/intuition-dev/mbToolBelt@v8.4.25/slotCustel/slotCustel/AbsSlotCustel.min.js';
class PgCustel extends AbsSlotCustel {
constructor() {
super();
console.log('pgComp');
this.setup(this.defTemplate);
this.addScript('https://cdn.jsdelivr.net/npm/list.js@1.5.0/dist/list.min.js', function () {
console.log('cons');
defEventFlux.addListener('contact-data', PgCustel.onData);
});
}
static onData(data) {
console.log('onData');
let options = {
valueNames: ['fname', 'lname', 'email', 'pass'],
item: `<tr>
<td class="fname"></td>
<td class="lname"></td>
<td class="email"></td>
<td class="org"> </td>
</tr>`
};
if (!(PgCustel.contactLst)) {
let contactLstEl = document.getElementById('contactLst');
PgCustel.contactLst = new List(contactLstEl, options, data);
}
else {
PgCustel.contactLst.add(data);
}
console.log('listjs', data);
}
}
customElements.define('pg-custel', PgCustel);
console.log('loaded');