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:
Ludwig Schubert
2017-11-08 09:43:29 -08:00
parent 70d8507938
commit e18d011fa8
5 changed files with 28 additions and 29 deletions
+1 -17
View File
@@ -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!');
}
}
}
}
+1 -1
View File
@@ -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";