This commit is contained in:
Mirco Wittrien 2019-06-13 11:13:18 +02:00
parent 64776e07b8
commit bb37e7bb9d
2 changed files with 20 additions and 2 deletions

View File

@ -643,7 +643,7 @@ class PluginRepo {
}
var loadingicon = BDFDB.htmlToElement(this.pluginRepoIconMarkup);
BDFDB.addClass(loadingicon, "pluginrepo-loadingicon");
loadingicon.addEventListener("mouseenter", () => {BDFDB.createTooltip("Loading PluginRepo",loadingicon,{type:"left",delay:500});})
loadingicon.addEventListener("mouseenter", () => {BDFDB.createTooltip(this.getLoadingTooltipText(),loadingicon,{type:"left",delay:500,style:"max-width:unset;",selector:"pluginrepo-loading-tooltip"});})
loadingiconwrapper.appendChild(loadingicon);
createFrame().then(() => {
@ -764,9 +764,18 @@ class PluginRepo {
}
}
i++;
var loadingtooltip = document.querySelector(".pluginrepo-loading-tooltip");
if (loadingtooltip) {
BDFDB.setInnerText(loadingtooltip.firstElementChild, this.getLoadingTooltipText());
BDFDB.updateTooltipPosition(loadingtooltip);
}
getPluginInfo(callback);
});
}
getLoadingTooltipText () {
return `Loading PluginRepo - [${Object.keys(this.loadedPlugins).length}/${Object.keys(this.grabbedPlugins).length}]`;
}
createFrame = () => {
var markup = this.frameMarkup;

View File

@ -774,7 +774,7 @@ class ThemeRepo {
}
var loadingicon = BDFDB.htmlToElement(this.themeRepoIconMarkup);
BDFDB.addClass(loadingicon, "themerepo-loadingicon");
loadingicon.addEventListener("mouseenter", () => {BDFDB.createTooltip("Loading ThemeRepo",loadingicon,{type:"left",delay:500});})
loadingicon.addEventListener("mouseenter", () => {BDFDB.createTooltip(this.getLoadingTooltipText(),loadingicon,{type:"left",delay:500,style:"max-width:unset;",selector:"themerepo-loading-tooltip"});})
loadingiconwrapper.appendChild(loadingicon);
getThemeInfo(() => {
@ -860,10 +860,19 @@ class ThemeRepo {
}
}
i++;
var loadingtooltip = document.querySelector(".themerepo-loading-tooltip");
if (loadingtooltip) {
BDFDB.setInnerText(loadingtooltip.firstElementChild, this.getLoadingTooltipText());
BDFDB.updateTooltipPosition(loadingtooltip);
}
getThemeInfo(callback);
});
}
}
getLoadingTooltipText () {
return `Loading ThemeRepo - [${Object.keys(this.loadedThemes).length}/${Object.keys(this.grabbedThemes).length}]`;
}
checkForNewThemes () {
require("request")("https://mwittrien.github.io/BetterDiscordAddons/Plugins/ThemeRepo/res/ThemeList.txt", (error, response, result) => {