mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-17 01:21:14 +08:00
This commit is contained in:
parent
cf4c5396ab
commit
eb54ebe5ac
@ -366,6 +366,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
|
|||||||
accelerator: window.siyuan.config.keymap.editor.general.openBy.custom + "/" + window.siyuan.languages.click,
|
accelerator: window.siyuan.config.keymap.editor.general.openBy.custom + "/" + window.siyuan.languages.click,
|
||||||
click() {
|
click() {
|
||||||
checkFold(refBlockId, (zoomIn, action) => {
|
checkFold(refBlockId, (zoomIn, action) => {
|
||||||
|
action.push(Constants.CB_GET_HL);
|
||||||
openFileById({
|
openFileById({
|
||||||
app: protyle.app,
|
app: protyle.app,
|
||||||
id: refBlockId,
|
id: refBlockId,
|
||||||
@ -397,6 +398,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
|
|||||||
accelerator: window.siyuan.config.keymap.editor.general.insertRight.custom + "/⌥" + window.siyuan.languages.click,
|
accelerator: window.siyuan.config.keymap.editor.general.insertRight.custom + "/⌥" + window.siyuan.languages.click,
|
||||||
click() {
|
click() {
|
||||||
checkFold(refBlockId, (zoomIn, action) => {
|
checkFold(refBlockId, (zoomIn, action) => {
|
||||||
|
action.push(Constants.CB_GET_HL);
|
||||||
openFileById({
|
openFileById({
|
||||||
app: protyle.app,
|
app: protyle.app,
|
||||||
id: refBlockId,
|
id: refBlockId,
|
||||||
@ -413,6 +415,7 @@ export const refMenu = (protyle: IProtyle, element: HTMLElement) => {
|
|||||||
accelerator: window.siyuan.config.keymap.editor.general.insertBottom.custom + (window.siyuan.config.keymap.editor.general.insertBottom.custom ? "/" : "") + "⇧" + window.siyuan.languages.click,
|
accelerator: window.siyuan.config.keymap.editor.general.insertBottom.custom + (window.siyuan.config.keymap.editor.general.insertBottom.custom ? "/" : "") + "⇧" + window.siyuan.languages.click,
|
||||||
click() {
|
click() {
|
||||||
checkFold(refBlockId, (zoomIn, action) => {
|
checkFold(refBlockId, (zoomIn, action) => {
|
||||||
|
action.push(Constants.CB_GET_HL);
|
||||||
openFileById({
|
openFileById({
|
||||||
app: protyle.app,
|
app: protyle.app,
|
||||||
id: refBlockId,
|
id: refBlockId,
|
||||||
|
@ -2043,7 +2043,6 @@ export class WYSIWYG {
|
|||||||
}
|
}
|
||||||
const range = getEditorRange(this.element);
|
const range = getEditorRange(this.element);
|
||||||
// 需放在嵌入块之前,否则嵌入块内的引用、链接、pdf 双链无法点击打开 https://ld246.com/article/1630479789513
|
// 需放在嵌入块之前,否则嵌入块内的引用、链接、pdf 双链无法点击打开 https://ld246.com/article/1630479789513
|
||||||
const blockRefElement = hasClosestByAttribute(event.target, "data-type", "block-ref");
|
|
||||||
const aElement = hasClosestByAttribute(event.target, "data-type", "a") ||
|
const aElement = hasClosestByAttribute(event.target, "data-type", "a") ||
|
||||||
hasClosestByClassName(event.target, "av__celltext--url"); // 数据库中资源文件、链接、电话、邮箱单元格
|
hasClosestByClassName(event.target, "av__celltext--url"); // 数据库中资源文件、链接、电话、邮箱单元格
|
||||||
let aLink = aElement ? (aElement.getAttribute("data-href") || "") : "";
|
let aLink = aElement ? (aElement.getAttribute("data-href") || "") : "";
|
||||||
@ -2058,6 +2057,7 @@ export class WYSIWYG {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const blockRefElement = hasClosestByAttribute(event.target, "data-type", "block-ref");
|
||||||
if (blockRefElement || aLink.startsWith("siyuan://blocks/")) {
|
if (blockRefElement || aLink.startsWith("siyuan://blocks/")) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@ -2073,6 +2073,8 @@ export class WYSIWYG {
|
|||||||
refBlockId = aLink.substring(16, 38);
|
refBlockId = aLink.substring(16, 38);
|
||||||
}
|
}
|
||||||
checkFold(refBlockId, (zoomIn, action) => {
|
checkFold(refBlockId, (zoomIn, action) => {
|
||||||
|
// 块引用跳转后需要短暂高亮目标块 https://github.com/siyuan-note/siyuan/issues/11542
|
||||||
|
action.push(Constants.CB_GET_HL);
|
||||||
/// #if MOBILE
|
/// #if MOBILE
|
||||||
openMobileFileById(protyle.app, refBlockId, zoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
openMobileFileById(protyle.app, refBlockId, zoomIn ? [Constants.CB_GET_ALL, Constants.CB_GET_HL] : [Constants.CB_GET_HL, Constants.CB_GET_CONTEXT, Constants.CB_GET_ROOTSCROLL]);
|
||||||
activeBlur();
|
activeBlur();
|
||||||
|
@ -1525,6 +1525,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||||||
const id = refElement.getAttribute("data-id");
|
const id = refElement.getAttribute("data-id");
|
||||||
if (matchHotKey(window.siyuan.config.keymap.editor.general.openBy.custom, event)) {
|
if (matchHotKey(window.siyuan.config.keymap.editor.general.openBy.custom, event)) {
|
||||||
checkFold(id, (zoomIn, action) => {
|
checkFold(id, (zoomIn, action) => {
|
||||||
|
action.push(Constants.CB_GET_HL);
|
||||||
openFileById({
|
openFileById({
|
||||||
app: protyle.app,
|
app: protyle.app,
|
||||||
id,
|
id,
|
||||||
@ -1551,6 +1552,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||||||
return true;
|
return true;
|
||||||
} else if (matchHotKey(window.siyuan.config.keymap.editor.general.insertRight.custom, event)) {
|
} else if (matchHotKey(window.siyuan.config.keymap.editor.general.insertRight.custom, event)) {
|
||||||
checkFold(id, (zoomIn, action) => {
|
checkFold(id, (zoomIn, action) => {
|
||||||
|
action.push(Constants.CB_GET_HL);
|
||||||
openFileById({
|
openFileById({
|
||||||
app: protyle.app,
|
app: protyle.app,
|
||||||
id,
|
id,
|
||||||
@ -1564,6 +1566,7 @@ export const keydown = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||||||
return true;
|
return true;
|
||||||
} else if (matchHotKey(window.siyuan.config.keymap.editor.general.insertBottom.custom, event)) {
|
} else if (matchHotKey(window.siyuan.config.keymap.editor.general.insertBottom.custom, event)) {
|
||||||
checkFold(id, (zoomIn, action) => {
|
checkFold(id, (zoomIn, action) => {
|
||||||
|
action.push(Constants.CB_GET_HL);
|
||||||
openFileById({
|
openFileById({
|
||||||
app: protyle.app,
|
app: protyle.app,
|
||||||
id,
|
id,
|
||||||
|
Loading…
Reference in New Issue
Block a user