♻️: 移除未使用代码

ISSUES CLOSED: #I5BUMN
This commit is contained in:
0o张不歪o0 2022-06-30 13:06:13 +08:00
parent 51b93ba96f
commit f15c380b44

View File

@ -75,9 +75,6 @@ export function calculateOffset(offset: any, area: any, type: any) {
if (offset instanceof Array && type === "drawer") { if (offset instanceof Array && type === "drawer") {
offset = "r"; offset = "r";
} }
if (offset instanceof Array && type === 6) {
offset = "rt-15";
}
// @ts-ignore // @ts-ignore
if (arr.indexOf(offset) > -1) { if (arr.indexOf(offset) > -1) {
t = "50%"; t = "50%";
@ -105,9 +102,6 @@ export function calculateOffset(offset: any, area: any, type: any) {
} else if (offset === "rb") { } else if (offset === "rb") {
t = "calc(100% - " + area[1] + ")"; t = "calc(100% - " + area[1] + ")";
l = "calc(100% - " + area[0] + ")"; l = "calc(100% - " + area[0] + ")";
} else if (offset === "rt-15") {
t = "15px";
l = "calc(100% - " + (parseFloat(area[0]) + 15) + "px)";
} }
// 返回位置 // 返回位置
@ -350,15 +344,12 @@ export function removeNotifiyFromQueen(layerId: string | undefined) {
// 间隙 // 间隙
let transOffsetTop = 15; let transOffsetTop = 15;
// @ts-ignore 删除项的高度 // @ts-ignore 删除项的高度
let offsetHeight = let offsetHeight =document.getElementById(layerId)?.firstElementChild?.firstElementChild?.offsetHeight;
document.getElementById(layerId)?.firstElementChild?.firstElementChild
?.offsetHeight;
// @ts-ignore // @ts-ignore
window.NotifiyQueen = window.NotifiyQueen || []; window.NotifiyQueen = window.NotifiyQueen || [];
// @ts-ignore // @ts-ignore
let notifiyQueen = window.NotifiyQueen; let notifiyQueen = window.NotifiyQueen;
//console.log(notifiyQueen) let index = notifiyQueen.findIndex((e: { id: string; }) => e.id === layerId)
let index = notifiyQueen.findIndex((e: { id: string }) => e.id === layerId);
let offsetType = notifiyQueen[index].offset; let offsetType = notifiyQueen[index].offset;
let list = notifiyQueen.filter((e: { offset: any }) => { let list = notifiyQueen.filter((e: { offset: any }) => {
if (e.offset === offsetType) { if (e.offset === offsetType) {
@ -373,14 +364,10 @@ export function removeNotifiyFromQueen(layerId: string | undefined) {
?.firstElementChild; ?.firstElementChild;
if (offsetType === "rt" || offsetType === "lt") { if (offsetType === "rt" || offsetType === "lt") {
// @ts-ignore // @ts-ignore
dom.style["top"] = dom.style["top"] = parseFloat(dom.style["top"]) - transOffsetTop - offsetHeight + "px";
parseFloat(dom.style["top"]) - transOffsetTop - offsetHeight + "px";
} else { } else {
// @ts-ignore // @ts-ignore
let bottom = let bottom =parseFloat(dom.style["top"].split(" - ")[1]) - transOffsetTop - offsetHeight;
parseFloat(dom.style["top"].split(" - ")[1]) -
transOffsetTop -
offsetHeight;
// @ts-ignore // @ts-ignore
dom.style["top"] = "calc(100vh - " + bottom + "px)"; dom.style["top"] = "calc(100vh - " + bottom + "px)";
} }