Commit 7efa2b82 authored by absturztaube's avatar absturztaube

add observer on preview

parent 83251b77
......@@ -127,8 +127,9 @@ function PleromaModLoader () {
function createObserver () {
this.containers = {
main: document.getElementsByClassName("main")[0],
notifications: document.getElementsByClassName("notifications")[0]
main: document.querySelector(".main"),
notifications: document.querySelector(".notifications"),
userPanel: document.querySelector(".user-panel")
};
const observerConfig = { subtree: true, childList: true };
......@@ -162,6 +163,9 @@ function PleromaModLoader () {
if (this.containers.notifications) {
this.observer.observe(this.containers.notifications, observerConfig);
}
if (this.containers.userPanel) {
this.observer.observe(this.containers.userPanel, observerConfig);
}
}
].forEach((fn) => { PleromaModLoader.prototype[fn.name] = fn; });
[
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment