mirror of
https://github.com/wassname/template.git
synced 2026-08-16 11:29:40 +08:00
Move controller registration to components; out of article tag as we now can have e.g. citations outside of article in title
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
// import { Template } from '../mixins/template';
|
||||
import { Controller } from '../controller';
|
||||
// import { Controller } from '../controller';
|
||||
|
||||
const isOnlyWhitespace = /^\s*$/;
|
||||
|
||||
@@ -29,20 +29,4 @@ export class Article extends HTMLElement {
|
||||
}).observe(this, {childList: true});
|
||||
}
|
||||
|
||||
connectedCallback() {
|
||||
document.onreadystatechange = function () {
|
||||
console.log('onreadystatechange:');
|
||||
console.log(document.readyState);
|
||||
};
|
||||
console.info('Article tag connected, we can now listen to controller events.');
|
||||
console.info('Runlevel 3->4.');
|
||||
for (const [functionName, callback] of Object.entries(Controller.listeners)) {
|
||||
if (typeof callback === 'function') {
|
||||
document.addEventListener(functionName, callback);
|
||||
} else {
|
||||
console.error('Controller listeners need to be functions!');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ export class HoverBox extends T(HTMLElement) {
|
||||
}
|
||||
|
||||
listen(element) {
|
||||
console.log(element)
|
||||
// console.log(element)
|
||||
this.bindDivEvents(this);
|
||||
this.bindTriggerEvents(element);
|
||||
// this.style.display = "block";
|
||||
|
||||
Reference in New Issue
Block a user