mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-07-03 14:09:06 +02:00
🎨 Block icons support quickly inserting blocks above or below https://github.com/siyuan-note/siyuan/issues/17900
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
@@ -587,7 +587,7 @@ export class Gutter {
|
||||
const centerY = iconRect.top + iconRect.height / 2;
|
||||
const lineH = 12;
|
||||
const top = centerY - lineH / 2;
|
||||
const plusSize = 20;
|
||||
const plusSize = 16;
|
||||
lineBefore.style.display = "";
|
||||
lineBefore.style.width = "2px";
|
||||
lineBefore.style.height = `${lineH}px`;
|
||||
@@ -612,7 +612,7 @@ export class Gutter {
|
||||
// 横排:框线贴块标上下边缘,+号定位在外偏位置
|
||||
const lineW = 10;
|
||||
const left = rect.left + (rect.width - lineW) / 2;
|
||||
const plusSize = 20;
|
||||
const plusSize = 16;
|
||||
const plusLeft = rect.left + (rect.width - plusSize) / 2;
|
||||
lineBefore.style.display = "";
|
||||
lineBefore.style.width = `${lineW}px`;
|
||||
@@ -2936,6 +2936,6 @@ data-type="fold" style="cursor:inherit;"><svg style="width: 10px;${fold && fold
|
||||
// 追加块标边缘悬浮触发的插入元素(默认隐藏,悬浮块标显示线条,悬浮线条变+号),由 mousemove 定位
|
||||
// 追加块标边缘的框线(悬浮块标显示)与+号(悬浮框线显示),默认隐藏,由 mousemove 定位
|
||||
// 双元素:框线贴块标边缘不移动(避免闪烁),+号独立定位在外偏位置,tooltip 基于+号元素对齐
|
||||
this.element.insertAdjacentHTML("beforeend", `<button class="protyle-gutters__line" data-type="gutterLineBefore" style="display:none"></button><button class="protyle-gutters__line" data-type="gutterLineAfter" style="display:none"></button><button class="protyle-gutters__plus ariaLabel" data-type="gutterPlusBefore" data-position="6west" aria-label="${window.siyuan.languages.insertBefore}" style="display:none"><svg><use xlink:href="#iconAdd"></use></svg></button><button class="protyle-gutters__plus ariaLabel" data-type="gutterPlusAfter" data-position="6west" aria-label="${window.siyuan.languages.insertAfter}" style="display:none"><svg><use xlink:href="#iconAdd"></use></svg></button>`);
|
||||
this.element.insertAdjacentHTML("beforeend", `<button class="protyle-gutters__line" data-type="gutterLineBefore" style="display:none"></button><button class="protyle-gutters__line" data-type="gutterLineAfter" style="display:none"></button><button class="protyle-gutters__plus ariaLabel" data-type="gutterPlusBefore" data-position="west" aria-label="${window.siyuan.languages.insertBefore}" style="display:none"><svg><use xlink:href="#iconAdd"></use></svg></button><button class="protyle-gutters__plus ariaLabel" data-type="gutterPlusAfter" data-position="west" aria-label="${window.siyuan.languages.insertAfter}" style="display:none"><svg><use xlink:href="#iconAdd"></use></svg></button>`);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user