mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-03-11 07:02:33 +01:00
This commit is contained in:
parent
671851235a
commit
4e3341985c
9 changed files with 25 additions and 23 deletions
|
|
@ -216,7 +216,7 @@ const genSelectItemHTML = (type: "selected" | "empty" | "unselect", id?: string,
|
|||
if (type === "empty") {
|
||||
if (id) {
|
||||
return `<button class="b3-menu__item" data-type="setRelationCell">
|
||||
<span class="b3-menu__label">${window.siyuan.languages.newRowInRelation.replace('${x}', text).replace('${y}', id)}</span>
|
||||
<span class="b3-menu__label">${window.siyuan.languages.newRowInRelation.replace("${x}", text).replace("${y}", id)}</span>
|
||||
</button>`;
|
||||
}
|
||||
return `<button class="b3-menu__item">
|
||||
|
|
@ -407,7 +407,7 @@ export const setRelationCell = (protyle: IProtyle, nodeElement: HTMLElement, tar
|
|||
}
|
||||
} else {
|
||||
const blockID = target.querySelector(".popover__block").getAttribute("data-id");
|
||||
const content = target.querySelector("b").textContent
|
||||
const content = target.querySelector("b").textContent;
|
||||
const rowId = Lute.NewNodeID();
|
||||
transaction(protyle, [{
|
||||
action: "insertAttrViewBlock",
|
||||
|
|
|
|||
|
|
@ -69,15 +69,15 @@ export class Toolbar {
|
|||
/// #endif
|
||||
this.toolbarHeight = 29;
|
||||
protyle.app.plugins.forEach(item => {
|
||||
const pluginToolbar = item.updateProtyleToolbar(options.toolbar)
|
||||
const pluginToolbar = item.updateProtyleToolbar(options.toolbar);
|
||||
pluginToolbar.forEach(toolbarItem => {
|
||||
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
if (window.siyuan.config.keymap.plugin && window.siyuan.config.keymap.plugin[item.name] && window.siyuan.config.keymap.plugin[item.name][toolbarItem.name]) {
|
||||
toolbarItem.hotkey = window.siyuan.config.keymap.plugin[item.name][toolbarItem.name].custom;
|
||||
}
|
||||
})
|
||||
});
|
||||
options.toolbar = toolbarKeyToMenu(pluginToolbar);
|
||||
});
|
||||
options.toolbar.forEach((menuItem: IMenuItem) => {
|
||||
|
|
@ -90,15 +90,15 @@ export class Toolbar {
|
|||
this.element.innerHTML = "";
|
||||
protyle.options.toolbar = toolbarKeyToMenu(Constants.PROTYLE_TOOLBAR);
|
||||
protyle.app.plugins.forEach(item => {
|
||||
const pluginToolbar = item.updateProtyleToolbar(protyle.options.toolbar)
|
||||
const pluginToolbar = item.updateProtyleToolbar(protyle.options.toolbar);
|
||||
pluginToolbar.forEach(toolbarItem => {
|
||||
if (typeof toolbarItem === "string" || Constants.INLINE_TYPE.concat("|").includes(toolbarItem.name) || !toolbarItem.hotkey) {
|
||||
return
|
||||
return;
|
||||
}
|
||||
if (window.siyuan.config.keymap.plugin && window.siyuan.config.keymap.plugin[item.name] && window.siyuan.config.keymap.plugin[item.name][toolbarItem.name]) {
|
||||
toolbarItem.hotkey = window.siyuan.config.keymap.plugin[item.name][toolbarItem.name].custom;
|
||||
}
|
||||
})
|
||||
});
|
||||
protyle.options.toolbar = toolbarKeyToMenu(pluginToolbar);
|
||||
});
|
||||
protyle.options.toolbar.forEach((menuItem: IMenuItem) => {
|
||||
|
|
|
|||
|
|
@ -1332,7 +1332,8 @@ export const dropEvent = (protyle: IProtyle, editorElement: HTMLElement) => {
|
|||
addDragover(targetElement);
|
||||
return;
|
||||
}
|
||||
if (targetElement.getAttribute("data-type") === "NodeListItem" || fileTreeIds.indexOf("-") > -1) {
|
||||
// 忘记为什么要限定文档树的拖拽了,先放开 https://github.com/siyuan-note/siyuan/pull/13284#issuecomment-2503853135
|
||||
if (targetElement.getAttribute("data-type") === "NodeListItem") {
|
||||
if (event.clientY > nodeRect.top + nodeRect.height / 2) {
|
||||
targetElement.classList.add("dragover__bottom");
|
||||
addDragover(targetElement);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue