stuff
This commit is contained in:
parent
c3e3f896fc
commit
983936dfca
|
@ -1505,14 +1505,8 @@ module.exports = (_ => {
|
||||||
text = typeof text == "function" ? text() : text;
|
text = typeof text == "function" ? text() : text;
|
||||||
if (typeof text != "string" && !BDFDB.ReactUtils.isValidElement(text) && !BDFDB.ObjectUtils.is(config.guild)) return null;
|
if (typeof text != "string" && !BDFDB.ReactUtils.isValidElement(text) && !BDFDB.ObjectUtils.is(config.guild)) return null;
|
||||||
let id = BDFDB.NumberUtils.generateId(Tooltips);
|
let id = BDFDB.NumberUtils.generateId(Tooltips);
|
||||||
let zIndexed = typeof config.zIndex == "number";
|
let zIndexed = config.zIndex && typeof config.zIndex == "number";
|
||||||
let itemLayer = BDFDB.DOMUtils.create(`<div class="${BDFDB.disCNS.itemlayer + BDFDB.disCN.itemlayerdisabledpointerevents}"><div class="${BDFDB.disCN.tooltip}" tooltip-id="${id}"><div class="${BDFDB.disCN.tooltippointer}"></div><div class="${BDFDB.disCN.tooltipcontent}"></div></div></div>`);
|
let itemLayer = BDFDB.DOMUtils.create(`<div class="${BDFDB.disCNS.itemlayer + BDFDB.disCN.itemlayerdisabledpointerevents}"><div class="${BDFDB.disCN.tooltip}" tooltip-id="${id}"><div class="${BDFDB.disCN.tooltippointer}"></div><div class="${BDFDB.disCN.tooltipcontent}"></div></div></div>`);
|
||||||
if (zIndexed) {
|
|
||||||
let itemLayerContainerClone = itemLayerContainer.cloneNode();
|
|
||||||
itemLayerContainerClone.style.setProperty("z-index", config.zIndex || 1002, "important");
|
|
||||||
itemLayerContainer.parentElement.insertBefore(itemLayerContainerClone, itemLayerContainer.nextElementSibling);
|
|
||||||
itemLayerContainer = itemLayerContainerClone;
|
|
||||||
}
|
|
||||||
itemLayerContainer.appendChild(itemLayer);
|
itemLayerContainer.appendChild(itemLayer);
|
||||||
|
|
||||||
let tooltip = itemLayer.firstElementChild;
|
let tooltip = itemLayer.firstElementChild;
|
||||||
|
@ -1538,10 +1532,12 @@ module.exports = (_ => {
|
||||||
style = (style ? (style + " ") : "") + `background: ${backgroundColor} !important; border-color: ${backgroundColorIsGradient ? BDFDB.ColorUtils.convert(config.backgroundColor[type == "left" ? 100 : 0], "RGBA") : backgroundColor} !important;`;
|
style = (style ? (style + " ") : "") + `background: ${backgroundColor} !important; border-color: ${backgroundColorIsGradient ? BDFDB.ColorUtils.convert(config.backgroundColor[type == "left" ? 100 : 0], "RGBA") : backgroundColor} !important;`;
|
||||||
}
|
}
|
||||||
if (style) tooltip.style = style;
|
if (style) tooltip.style = style;
|
||||||
|
const zIndexed = config.zIndex && typeof config.zIndex == "number";
|
||||||
if (zIndexed) {
|
if (zIndexed) {
|
||||||
itemLayer.style.setProperty("z-index", config.zIndex || 1002, "important");
|
itemLayer.style.setProperty("z-index", config.zIndex, "important");
|
||||||
tooltip.style.setProperty("z-index", config.zIndex || 1002, "important");
|
tooltip.style.setProperty("z-index", config.zIndex, "important");
|
||||||
tooltipContent.style.setProperty("z-index", config.zIndex || 1002, "important");
|
tooltipContent.style.setProperty("z-index", config.zIndex, "important");
|
||||||
|
BDFDB.DOMUtils.addClass(itemLayerContainer, BDFDB.disCN.itemlayercontainerzindexdisabled);
|
||||||
}
|
}
|
||||||
if (typeof config.width == "number" && config.width > 196) {
|
if (typeof config.width == "number" && config.width > 196) {
|
||||||
tooltip.style.setProperty("width", `${config.width}px`, "important");
|
tooltip.style.setProperty("width", `${config.width}px`, "important");
|
||||||
|
@ -1560,7 +1556,7 @@ module.exports = (_ => {
|
||||||
let parent = e.target.parentElement.querySelector(":hover");
|
let parent = e.target.parentElement.querySelector(":hover");
|
||||||
if (parent && anker != parent && !anker.contains(parent)) itemLayer.removeTooltip();
|
if (parent && anker != parent && !anker.contains(parent)) itemLayer.removeTooltip();
|
||||||
};
|
};
|
||||||
let mouseLeave = e => {itemLayer.removeTooltip();};
|
let mouseLeave = e => itemLayer.removeTooltip();
|
||||||
if (!config.perssist) {
|
if (!config.perssist) {
|
||||||
document.addEventListener("mousemove", mouseMove);
|
document.addEventListener("mousemove", mouseMove);
|
||||||
document.addEventListener("mouseleave", mouseLeave);
|
document.addEventListener("mouseleave", mouseLeave);
|
||||||
|
@ -1655,7 +1651,7 @@ module.exports = (_ => {
|
||||||
BDFDB.DOMUtils.remove(itemLayer);
|
BDFDB.DOMUtils.remove(itemLayer);
|
||||||
BDFDB.ArrayUtils.remove(Tooltips, id);
|
BDFDB.ArrayUtils.remove(Tooltips, id);
|
||||||
observer.disconnect();
|
observer.disconnect();
|
||||||
if (zIndexed) BDFDB.DOMUtils.remove(itemLayerContainer);
|
if (zIndexed) BDFDB.DOMUtils.removeClass(itemLayerContainer, BDFDB.disCN.itemlayercontainerzindexdisabled);
|
||||||
if (typeof config.onHide == "function") config.onHide(itemLayer, anker);
|
if (typeof config.onHide == "function") config.onHide(itemLayer, anker);
|
||||||
});
|
});
|
||||||
(tooltip.update = itemLayer.update = newText => {
|
(tooltip.update = itemLayer.update = newText => {
|
||||||
|
|
|
@ -557,6 +557,11 @@
|
||||||
"inputNumberWrapper": "numberInputWrapper-j4svZS",
|
"inputNumberWrapper": "numberInputWrapper-j4svZS",
|
||||||
"inputNumberWrapperDefault": "numberInputWrapperDefault-gRxcuK numberInputWrapper-j4svZS",
|
"inputNumberWrapperDefault": "numberInputWrapperDefault-gRxcuK numberInputWrapper-j4svZS",
|
||||||
"inputNumberWrapperMini": "numberInputWrapperMini-wtUU31 numberInputWrapper-j4svZS",
|
"inputNumberWrapperMini": "numberInputWrapperMini-wtUU31 numberInputWrapper-j4svZS",
|
||||||
|
"layerContainerZIndexDisabled": "zIndexDisabled-Pf4Txx",
|
||||||
|
"listInput": "listInput-11g5Sr",
|
||||||
|
"listInputDelete": "delete-M_nPTt",
|
||||||
|
"listInputItem": "item-wGC8aX",
|
||||||
|
"listInputItems": "items-D9PGwH",
|
||||||
"listRow": "listRow-7SfZww",
|
"listRow": "listRow-7SfZww",
|
||||||
"loadingIcon": "loadingIcon-cOYMPl",
|
"loadingIcon": "loadingIcon-cOYMPl",
|
||||||
"loadingIconWrapper": "loadingIconWrapper-PsVJ9m",
|
"loadingIconWrapper": "loadingIconWrapper-PsVJ9m",
|
||||||
|
@ -573,10 +578,6 @@
|
||||||
"paginationTop": "top-v-18jZ",
|
"paginationTop": "top-v-18jZ",
|
||||||
"popoutWrapper": "popout-xwjvsX",
|
"popoutWrapper": "popout-xwjvsX",
|
||||||
"quickSelectWrapper": "quickSelectWrapper-UCfTKz",
|
"quickSelectWrapper": "quickSelectWrapper-UCfTKz",
|
||||||
"listInput": "listInput-11g5Sr",
|
|
||||||
"listInputDelete": "delete-M_nPTt",
|
|
||||||
"listInputItem": "item-wGC8aX",
|
|
||||||
"listInputItems": "items-D9PGwH",
|
|
||||||
"marginLeft4": "marginLeft4-58StzA",
|
"marginLeft4": "marginLeft4-58StzA",
|
||||||
"marginLeft8": "marginLeft8-3RhhAa",
|
"marginLeft8": "marginLeft8-3RhhAa",
|
||||||
"menuColorCustom": "colorCustom-44asd2",
|
"menuColorCustom": "colorCustom-44asd2",
|
||||||
|
@ -2032,6 +2033,7 @@
|
||||||
"imagezoom": ["ImageWrapper", "imageZoom"],
|
"imagezoom": ["ImageWrapper", "imageZoom"],
|
||||||
"itemlayer": ["ItemLayerContainer", "layer"],
|
"itemlayer": ["ItemLayerContainer", "layer"],
|
||||||
"itemlayercontainer": ["ItemLayerContainer", "layerContainer"],
|
"itemlayercontainer": ["ItemLayerContainer", "layerContainer"],
|
||||||
|
"itemlayercontainerzindexdisabled": ["BDFDB", "layerContainerZIndexDisabled"],
|
||||||
"itemlayerdisabledpointerevents": ["ItemLayerContainer", "disabledPointerEvents"],
|
"itemlayerdisabledpointerevents": ["ItemLayerContainer", "disabledPointerEvents"],
|
||||||
"input": ["Input", "input"],
|
"input": ["Input", "input"],
|
||||||
"inputdefault": ["Input", "inputDefault"],
|
"inputdefault": ["Input", "inputDefault"],
|
||||||
|
|
|
@ -8,6 +8,12 @@ img:not([src]), img[src=""], img[src="null"] {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[REPLACE_CLASS_itemlayercontainerzindexdisabled] {
|
||||||
|
z-index: unset;
|
||||||
|
}
|
||||||
|
[REPLACE_CLASS_itemlayercontainerzindexdisabled] > * {
|
||||||
|
z-index: 1002;
|
||||||
|
}
|
||||||
[REPLACE_CLASS_itemlayer] ~ [REPLACE_CLASS_itemlayer] [REPLACE_CLASS_menu] {
|
[REPLACE_CLASS_itemlayer] ~ [REPLACE_CLASS_itemlayer] [REPLACE_CLASS_menu] {
|
||||||
z-index: 1001;
|
z-index: 1001;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue