mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-18 15:40:12 +01:00
🎨 Clean code
This commit is contained in:
parent
f1f34761c8
commit
744dc2b7f3
2 changed files with 4 additions and 4 deletions
|
|
@ -270,9 +270,9 @@ export const copyTab = (app: App, tab: Tab) => {
|
||||||
afterInitProtyle(editor) {
|
afterInitProtyle(editor) {
|
||||||
// https://github.com/siyuan-note/siyuan/issues/13851
|
// https://github.com/siyuan-note/siyuan/issues/13851
|
||||||
if (tab.model instanceof Editor) {
|
if (tab.model instanceof Editor) {
|
||||||
const copyResizeTopElement = tab.model.editor.protyle.wysiwyg.element.querySelector("[data-resize-top]")
|
const copyResizeTopElement = tab.model.editor.protyle.wysiwyg.element.querySelector("[data-resize-top]");
|
||||||
if (copyResizeTopElement) {
|
if (copyResizeTopElement) {
|
||||||
const newElement = editor.protyle.wysiwyg.element.querySelector(`[data-node-id="${copyResizeTopElement.getAttribute("data-node-id")}"]`)
|
const newElement = editor.protyle.wysiwyg.element.querySelector(`[data-node-id="${copyResizeTopElement.getAttribute("data-node-id")}"]`);
|
||||||
if (newElement) {
|
if (newElement) {
|
||||||
editor.protyle.observerLoad?.disconnect();
|
editor.protyle.observerLoad?.disconnect();
|
||||||
newElement.scrollIntoView();
|
newElement.scrollIntoView();
|
||||||
|
|
|
||||||
|
|
@ -194,11 +194,11 @@ export const removeBlock = async (protyle: IProtyle, blockElement: Element, rang
|
||||||
|
|
||||||
hideElements(["util"], protyle);
|
hideElements(["util"], protyle);
|
||||||
if (!sideElement) {
|
if (!sideElement) {
|
||||||
const backlinkElement = hasClosestByClassName(protyle.element, "sy__backlink", true)
|
const backlinkElement = hasClosestByClassName(protyle.element, "sy__backlink", true);
|
||||||
if (backlinkElement) {
|
if (backlinkElement) {
|
||||||
const backLinkTab = getInstanceById(backlinkElement.getAttribute("data-id"), window.siyuan.layout.layout);
|
const backLinkTab = getInstanceById(backlinkElement.getAttribute("data-id"), window.siyuan.layout.layout);
|
||||||
if (backLinkTab instanceof Tab && backLinkTab.model instanceof Backlink) {
|
if (backLinkTab instanceof Tab && backLinkTab.model instanceof Backlink) {
|
||||||
const editors = backLinkTab.model.editors
|
const editors = backLinkTab.model.editors;
|
||||||
editors.find((item, index) => {
|
editors.find((item, index) => {
|
||||||
if (item.protyle.element.isSameNode(protyle.element)) {
|
if (item.protyle.element.isSameNode(protyle.element)) {
|
||||||
item.destroy();
|
item.destroy();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue