This commit is contained in:
Mirco Wittrien 2019-09-24 13:34:41 +02:00
parent 3ab3077e74
commit d44171c90c
2 changed files with 3 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -3179,7 +3179,7 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
};
BDFDB.openDropdownMenu = function (e, callback, createinner, values, above = false, dark = BDFDB.getDiscordTheme() == BDFDB.disCN.themedark) {
if (typeof callback != 'function' || typeof createinner != 'function' || !values || (typeof values != 'object' && Array.isArray(values))) return;
if (typeof callback != 'function' || typeof createinner != 'function' || !values || typeof values != 'object') return;
let selectControl = (BDFDB.getParentEle(BDFDB.dotCN.selectwrap, e.currentTarget) || e.currentTarget).querySelector(BDFDB.dotCN.selectcontrol);
let selectWrap = selectControl.parentElement;
if (BDFDB.containsClass(selectWrap, BDFDB.disCN.selectisopen)) return;
@ -3190,8 +3190,7 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
var oldchoice = selectWrap.getAttribute('value');
var suffix = dark ? 'dark' : 'light';
var menuhtml = `<div class="${BDFDB.disCNS.selectmenuouter + BDFDB.disCN["selectmenuouter" + suffix]}"><div class="${BDFDB.disCN.selectmenu}">`;
if (Array.isArray(values)) for (var key of values) menuhtml += `<div value="${key}" class="${BDFDB.disCNS.selectoption + (key == oldchoice ? BDFDB.disCN["selectoptionselect" + suffix] : BDFDB.disCN["selectoption" + suffix])}" style="flex: 1 1 auto; display: flex;">${createinner(key)}</div>`;
else for (var key in values) menuhtml += `<div value="${key}" class="${BDFDB.disCNS.selectoption + (key == oldchoice ? BDFDB.disCN["selectoptionselect" + suffix] : BDFDB.disCN["selectoption" + suffix])}" style="flex: 1 1 auto; display: flex;">${createinner(key)}</div>`;
for (var key in values) menuhtml += `<div value="${key}" class="${BDFDB.disCNS.selectoption + (key == oldchoice ? BDFDB.disCN["selectoptionselect" + suffix] : BDFDB.disCN["selectoption" + suffix])}" style="flex: 1 1 auto; display: flex;">${createinner(key)}</div>`;
menuhtml += `</div></div>`;
var selectMenu = BDFDB.htmlToElement(menuhtml);
if (above) {