lib
This commit is contained in:
parent
054350b7e0
commit
53898418f7
File diff suppressed because one or more lines are too long
|
@ -2633,41 +2633,41 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
container.querySelectorAll(".BDFDB-containertext").forEach(ele => {
|
container.querySelectorAll(".BDFDB-containertext").forEach(ele => {
|
||||||
if (BDFDB.containsClass(ele.nextElementSibling, "BDFDB-collapsecontainer")) {
|
if (BDFDB.containsClass(ele.nextElementSibling, "BDFDB-collapsecontainer")) {
|
||||||
if (BDFDB.containsClass(ele.firstElementChild, "closed")) BDFDB.toggleEles(ele.nextElementSibling, false);
|
if (BDFDB.containsClass(ele.firstElementChild, "closed")) BDFDB.toggleEles(ele.nextElementSibling, false);
|
||||||
ele.BDFDBinitElement = () => {
|
ele.BDFDBupdateElement = () => {
|
||||||
BDFDB.toggleEles(ele.nextElementSibling, BDFDB.containsClass(ele.firstElementChild, "closed"));
|
BDFDB.toggleEles(ele.nextElementSibling, BDFDB.containsClass(ele.firstElementChild, "closed"));
|
||||||
BDFDB.toggleClass(ele.firstElementChild, "closed");
|
BDFDB.toggleClass(ele.firstElementChild, "closed");
|
||||||
};
|
};
|
||||||
addInitEventListener(ele, 'click', ele.BDFDBinitElement);
|
addInitEventListener(ele, 'click', ele.BDFDBupdateElement);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
container.querySelectorAll(BDFDB.dotCN.switchinner).forEach(ele => {
|
container.querySelectorAll(BDFDB.dotCN.switchinner).forEach(ele => {
|
||||||
setSwitch(ele, false);
|
setSwitch(ele, false);
|
||||||
ele.BDFDBinitElement = () => {
|
ele.BDFDBupdateElement = () => {
|
||||||
setSwitch(ele, true);
|
setSwitch(ele, true);
|
||||||
};
|
};
|
||||||
addInitEventListener(ele, 'click', ele.BDFDBinitElement);
|
addInitEventListener(ele, 'click', ele.BDFDBupdateElement);
|
||||||
});
|
});
|
||||||
container.querySelectorAll(BDFDB.dotCNS.checkboxwrapper + BDFDB.dotCN.checkboxinput).forEach(ele => {
|
container.querySelectorAll(BDFDB.dotCNS.checkboxwrapper + BDFDB.dotCN.checkboxinput).forEach(ele => {
|
||||||
setCheckbox(ele);
|
setCheckbox(ele);
|
||||||
ele.BDFDBinitElement = () => {
|
ele.BDFDBupdateElement = () => {
|
||||||
setCheckbox(ele);
|
setCheckbox(ele);
|
||||||
};
|
};
|
||||||
addInitEventListener(ele, 'click', ele.BDFDBinitElement);
|
addInitEventListener(ele, 'click', ele.BDFDBupdateElement);
|
||||||
});
|
});
|
||||||
container.querySelectorAll(BDFDB.dotCN.giffavoritebutton).forEach(ele => {
|
container.querySelectorAll(BDFDB.dotCN.giffavoritebutton).forEach(ele => {
|
||||||
setGifFavButton(ele);
|
setGifFavButton(ele);
|
||||||
ele.BDFDBinitElement = () => {
|
ele.BDFDBupdateElement = () => {
|
||||||
BDFDB.toggleClass(ele, BDFDB.disCN.giffavoriteselected);
|
BDFDB.toggleClass(ele, BDFDB.disCN.giffavoriteselected);
|
||||||
setGifFavButton(ele);
|
setGifFavButton(ele);
|
||||||
};
|
};
|
||||||
addInitEventListener(ele, 'click', ele.BDFDBinitElement);
|
addInitEventListener(ele, 'click', ele.BDFDBupdateElement);
|
||||||
});
|
});
|
||||||
container.querySelectorAll('.file-navigator').forEach(ele => {
|
container.querySelectorAll('.file-navigator').forEach(ele => {
|
||||||
ele.BDFDBinitElement = () => {
|
ele.BDFDBupdateElement = () => {
|
||||||
var input = ele.querySelector('input[type="file"]');
|
var input = ele.querySelector('input[type="file"]');
|
||||||
if (input) input.click();
|
if (input) input.click();
|
||||||
};
|
};
|
||||||
addInitEventListener(ele, 'click', ele.BDFDBinitElement);
|
addInitEventListener(ele, 'click', ele.BDFDBupdateElement);
|
||||||
});
|
});
|
||||||
container.querySelectorAll('input[type="file"]').forEach(ele => {
|
container.querySelectorAll('input[type="file"]').forEach(ele => {
|
||||||
addInitEventListener(ele, 'change', e => {
|
addInitEventListener(ele, 'change', e => {
|
||||||
|
@ -2940,9 +2940,9 @@ var BDFDB = {myPlugins: BDFDB && BDFDB.myPlugins ? BDFDB.myPlugins : {}, BDv2Api
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
function addInitEventListener(ele, action, callback) {
|
function addInitEventListener(ele, action, callback) {
|
||||||
if (!ele.BDFDBinitElementsListeners) ele.BDFDBinitElementsListeners = {};
|
if (!ele.BDFDBupdateElementsListeners) ele.BDFDBupdateElementsListeners = {};
|
||||||
if (ele.BDFDBinitElementsListeners[action]) ele.removeEventListener(action, ele.BDFDBinitElementsListeners[action]);
|
if (ele.BDFDBupdateElementsListeners[action]) ele.removeEventListener(action, ele.BDFDBupdateElementsListeners[action]);
|
||||||
ele.BDFDBinitElementsListeners[action] = callback;
|
ele.BDFDBupdateElementsListeners[action] = callback;
|
||||||
ele.addEventListener(action, callback, true);
|
ele.addEventListener(action, callback, true);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue