mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 00:38:49 +01:00
This commit is contained in:
parent
b5e6da4569
commit
ef614963cf
2 changed files with 45 additions and 9 deletions
|
|
@ -19,7 +19,7 @@ export class Backlink extends Model {
|
|||
private tree: Tree;
|
||||
private notebookId: string;
|
||||
private mTree: Tree;
|
||||
private editors: Protyle[] = [];
|
||||
public editors: Protyle[] = [];
|
||||
public status: {
|
||||
[key: string]: {
|
||||
sort: string,
|
||||
|
|
|
|||
|
|
@ -100,21 +100,39 @@ export const globalShortcut = () => {
|
|||
if (!targetBlockElement) {
|
||||
return;
|
||||
}
|
||||
const hasTab = getAllModels().editor.find(item => {
|
||||
const allModels = getAllModels()
|
||||
let findNode = false
|
||||
allModels.editor.find(item => {
|
||||
if (item.editor.protyle.wysiwyg.element.isSameNode(eventPath0)) {
|
||||
item.editor.protyle.gutter.render(targetBlockElement, item.editor.protyle.wysiwyg.element);
|
||||
findNode = true
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (!hasTab) {
|
||||
if (!findNode) {
|
||||
window.siyuan.blockPanels.find(item => {
|
||||
const hasEdit = item.editors.find(eItem => {
|
||||
item.editors.find(eItem => {
|
||||
if (eItem.protyle.wysiwyg.element.contains(eventPath0)) {
|
||||
eItem.protyle.gutter.render(targetBlockElement, eItem.protyle.wysiwyg.element);
|
||||
findNode = true;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (hasEdit) {
|
||||
if (findNode) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!findNode) {
|
||||
allModels.backlink.find(item => {
|
||||
item.editors.find(eItem => {
|
||||
if (eItem.protyle.wysiwyg.element.isSameNode(eventPath0)) {
|
||||
eItem.protyle.gutter.render(targetBlockElement, eItem.protyle.wysiwyg.element);
|
||||
findNode = true
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (findNode) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
|
@ -128,21 +146,39 @@ export const globalShortcut = () => {
|
|||
if (!targetBlockElement) {
|
||||
return;
|
||||
}
|
||||
const hasTab = getAllModels().editor.find(item => {
|
||||
const allModels = getAllModels();
|
||||
let findNode = false;
|
||||
allModels.editor.find(item => {
|
||||
if (item.editor.protyle.wysiwyg.element.contains(eventPath0)) {
|
||||
item.editor.protyle.gutter.render(targetBlockElement, item.editor.protyle.wysiwyg.element);
|
||||
findNode = true
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (!hasTab) {
|
||||
if (!findNode) {
|
||||
window.siyuan.blockPanels.find(item => {
|
||||
const hasEdit = item.editors.find(eItem => {
|
||||
item.editors.find(eItem => {
|
||||
if (eItem.protyle.wysiwyg.element.contains(eventPath0)) {
|
||||
eItem.protyle.gutter.render(targetBlockElement, eItem.protyle.wysiwyg.element);
|
||||
findNode = true;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (hasEdit) {
|
||||
if (findNode) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
}
|
||||
if (!findNode) {
|
||||
allModels.backlink.find(item => {
|
||||
item.editors.find(eItem => {
|
||||
if (eItem.protyle.wysiwyg.element.contains(eventPath0)) {
|
||||
eItem.protyle.gutter.render(targetBlockElement, eItem.protyle.wysiwyg.element);
|
||||
findNode = true
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (findNode) {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue