Update ServerFolders.plugin.js
This commit is contained in:
parent
c39107bc81
commit
66930c3eb7
|
@ -3,7 +3,7 @@
|
||||||
class ServerFolders {
|
class ServerFolders {
|
||||||
getName () {return "ServerFolders";}
|
getName () {return "ServerFolders";}
|
||||||
|
|
||||||
getVersion () {return "6.5.8";}
|
getVersion () {return "6.5.9";}
|
||||||
|
|
||||||
getAuthor () {return "DevilBro";}
|
getAuthor () {return "DevilBro";}
|
||||||
|
|
||||||
|
@ -816,14 +816,11 @@ class ServerFolders {
|
||||||
updateGuildInFolderContent (folderid, guildid) {
|
updateGuildInFolderContent (folderid, guildid) {
|
||||||
if (!this.foldercontentguilds || !folderid || !guildid) return;
|
if (!this.foldercontentguilds || !folderid || !guildid) return;
|
||||||
let guild = BDFDB.LibraryModules.GuildStore.getGuild(guildid);
|
let guild = BDFDB.LibraryModules.GuildStore.getGuild(guildid);
|
||||||
if (guild) {
|
|
||||||
let oldCopy = this.foldercontentguilds.querySelector(`.copy[guildid="${guildid}"]`);
|
let oldCopy = this.foldercontentguilds.querySelector(`.copy[guildid="${guildid}"]`);
|
||||||
|
if (guild) {
|
||||||
let newCopy = this.createCopyOfServer(folderid, guildid);
|
let newCopy = this.createCopyOfServer(folderid, guildid);
|
||||||
if (!newCopy) return;
|
if (newCopy) {
|
||||||
else if (oldCopy) {
|
if (oldCopy) this.foldercontentguilds.insertBefore(newCopy, oldCopy);
|
||||||
this.foldercontentguilds.insertBefore(newCopy, oldCopy);
|
|
||||||
BDFDB.DOMUtils.remove(oldCopy);
|
|
||||||
}
|
|
||||||
else {
|
else {
|
||||||
let folder = BDFDB.LibraryModules.FolderStore.getGuildFolderById(folderid);
|
let folder = BDFDB.LibraryModules.FolderStore.getGuildFolderById(folderid);
|
||||||
let position = folder.guildIds.indexOf(guildid);
|
let position = folder.guildIds.indexOf(guildid);
|
||||||
|
@ -838,6 +835,8 @@ class ServerFolders {
|
||||||
if (BDFDB.DOMUtils.containsClass(this.foldercontentguilds.firstElementChild, "folderseparatorouter")) BDFDB.DOMUtils.remove(this.foldercontentguilds.firstElementChild);
|
if (BDFDB.DOMUtils.containsClass(this.foldercontentguilds.firstElementChild, "folderseparatorouter")) BDFDB.DOMUtils.remove(this.foldercontentguilds.firstElementChild);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
BDFDB.DOMUtils.remove(oldCopy);
|
||||||
|
}
|
||||||
|
|
||||||
addSeparator (folderid) {
|
addSeparator (folderid) {
|
||||||
if (!this.foldercontentguilds) return;
|
if (!this.foldercontentguilds) return;
|
||||||
|
@ -946,6 +945,7 @@ class ServerFolders {
|
||||||
};
|
};
|
||||||
|
|
||||||
guildcopyinner.addEventListener("mouseenter", () => {
|
guildcopyinner.addEventListener("mouseenter", () => {
|
||||||
|
if (!BDFDB.LibraryModules.GuildStore.getGuild(guildid)) return BDFDB.DOMUtils.remove(guildcopy);
|
||||||
let EditServers = BDFDB.BDUtils.getPlugin("EditServers");
|
let EditServers = BDFDB.BDUtils.getPlugin("EditServers");
|
||||||
let ESdata = EditServers ? EditServers.getGuildData(guildid, guildcopyinner) : null;
|
let ESdata = EditServers ? EditServers.getGuildData(guildid, guildcopyinner) : null;
|
||||||
if (ESdata && (ESdata.name || ESdata.color3 || ESdata.color4)) EditServers.changeTooltip(guild, guildcopyinner, "right");
|
if (ESdata && (ESdata.name || ESdata.color3 || ESdata.color4)) EditServers.changeTooltip(guild, guildcopyinner, "right");
|
||||||
|
|
Loading…
Reference in New Issue