mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-12 23:21:23 +08:00
🎨 Clean code
This commit is contained in:
parent
d26972d96a
commit
3b9cae1c03
@ -30,7 +30,7 @@ export class Dock {
|
|||||||
public resizeElement: HTMLElement;
|
public resizeElement: HTMLElement;
|
||||||
public pin = true;
|
public pin = true;
|
||||||
public data: { [key: string]: Model | boolean };
|
public data: { [key: string]: Model | boolean };
|
||||||
private hideResizeTimeout:number
|
private hideResizeTimeout:number;
|
||||||
|
|
||||||
constructor(options: {
|
constructor(options: {
|
||||||
app: App,
|
app: App,
|
||||||
|
@ -3,7 +3,7 @@ import {getInstanceById} from "../layout/util";
|
|||||||
import {Tab} from "../layout/Tab";
|
import {Tab} from "../layout/Tab";
|
||||||
import {initSearchMenu} from "./search";
|
import {initSearchMenu} from "./search";
|
||||||
import {initDockMenu} from "./dock";
|
import {initDockMenu} from "./dock";
|
||||||
import {initNavigationMenu, initFileMenu} from "./navigation";
|
import {initFileMenu, initNavigationMenu} from "./navigation";
|
||||||
import {initTabMenu} from "./tab";
|
import {initTabMenu} from "./tab";
|
||||||
/// #endif
|
/// #endif
|
||||||
import {Menu} from "./Menu";
|
import {Menu} from "./Menu";
|
||||||
@ -74,7 +74,7 @@ export class Menus {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (hasClosestByClassName(target, "av__panel") && !hasClosestByClassName(target, "b3-menu")) {
|
if (hasClosestByClassName(target, "av__panel") && !hasClosestByClassName(target, "b3-menu")) {
|
||||||
document.querySelector(".av__panel").dispatchEvent(new CustomEvent("click", {detail: "close"}))
|
document.querySelector(".av__panel").dispatchEvent(new CustomEvent("click", {detail: "close"}));
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -3,20 +3,14 @@ import {
|
|||||||
hasClosestByAttribute,
|
hasClosestByAttribute,
|
||||||
hasClosestByClassName,
|
hasClosestByClassName,
|
||||||
hasClosestByMatchTag,
|
hasClosestByMatchTag,
|
||||||
hasClosestByTag, hasTopClosestByClassName
|
hasClosestByTag,
|
||||||
|
hasTopClosestByClassName
|
||||||
} from "../util/hasClosest";
|
} from "../util/hasClosest";
|
||||||
import {getIconByType} from "../../editor/getIcon";
|
import {getIconByType} from "../../editor/getIcon";
|
||||||
import {enterBack, iframeMenu, setFold, tableMenu, videoMenu, zoomOut} from "../../menus/protyle";
|
import {enterBack, iframeMenu, setFold, tableMenu, videoMenu, zoomOut} from "../../menus/protyle";
|
||||||
import {MenuItem} from "../../menus/Menu";
|
import {MenuItem} from "../../menus/Menu";
|
||||||
import {copySubMenu, openAttr, openWechatNotify} from "../../menus/commonMenuItem";
|
import {copySubMenu, openAttr, openWechatNotify} from "../../menus/commonMenuItem";
|
||||||
import {
|
import {copyPlainText, isMac, isOnlyMeta, openByMobile, updateHotkeyTip, writeText} from "../util/compatibility";
|
||||||
copyPlainText,
|
|
||||||
isMac,
|
|
||||||
isOnlyMeta,
|
|
||||||
openByMobile,
|
|
||||||
updateHotkeyTip,
|
|
||||||
writeText
|
|
||||||
} from "../util/compatibility";
|
|
||||||
import {
|
import {
|
||||||
transaction,
|
transaction,
|
||||||
turnsIntoOneTransaction,
|
turnsIntoOneTransaction,
|
||||||
@ -842,7 +836,7 @@ export class Gutter {
|
|||||||
srcIDs: sourceIds,
|
srcIDs: sourceIds,
|
||||||
avID,
|
avID,
|
||||||
}]);
|
}]);
|
||||||
focusBlock(selectsElement[0])
|
focusBlock(selectsElement[0]);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
@ -1303,7 +1297,7 @@ export class Gutter {
|
|||||||
srcIDs: sourceIds,
|
srcIDs: sourceIds,
|
||||||
avID,
|
avID,
|
||||||
}]);
|
}]);
|
||||||
focusBlock(nodeElement)
|
focusBlock(nodeElement);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).element);
|
}).element);
|
||||||
|
@ -446,12 +446,12 @@ export const popTextCell = (protyle: IProtyle, cellElements: HTMLElement[], type
|
|||||||
updateCellValueByInput(protyle, type, blockElement, cellElements);
|
updateCellValueByInput(protyle, type, blockElement, cellElements);
|
||||||
avMaskElement?.remove();
|
avMaskElement?.remove();
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
avMaskElement.addEventListener("click", (event) => {
|
avMaskElement.addEventListener("click", (event) => {
|
||||||
removeAvMask(event)
|
removeAvMask(event);
|
||||||
});
|
});
|
||||||
avMaskElement.addEventListener("contextmenu", (event) => {
|
avMaskElement.addEventListener("contextmenu", (event) => {
|
||||||
removeAvMask(event)
|
removeAvMask(event);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user