update mod loader

This commit is contained in:
Your New SJW Waifu 2020-07-12 16:19:00 -05:00
parent a1fe484421
commit 7e9cbba892
1 changed files with 10 additions and 2 deletions

View File

@ -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;
}