update mod loader
This commit is contained in:
parent
a1fe484421
commit
7e9cbba892
|
@ -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; });
|
||||
[
|
||||
|
@ -200,6 +204,10 @@ function PleromaModLoader () {
|
|||
});
|
||||
},
|
||||
|
||||
function getToken () {
|
||||
return document.querySelector("#app").__vue__.$store._vm.getUserToken();
|
||||
},
|
||||
|
||||
function getModDir () {
|
||||
return window.__pleromaModLoader.config.modDirectory;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue