mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
✨ https://github.com/siyuan-note/siyuan/issues/8895 block attr
This commit is contained in:
parent
17055347db
commit
435ad45cb5
14 changed files with 258 additions and 186 deletions
|
|
@ -58,7 +58,7 @@ export const openMenuPanel = (options: {
|
|||
</div>`);
|
||||
avPanelElement = document.querySelector(".av__panel");
|
||||
const menuElement = avPanelElement.lastElementChild as HTMLElement;
|
||||
const tabRect = options.blockElement.querySelector(".layout-tab-bar").getBoundingClientRect();
|
||||
const tabRect = options.blockElement.querySelector(".layout-tab-bar")?.getBoundingClientRect();
|
||||
if (["select", "date", "asset"].includes(options.type)) {
|
||||
const cellRect = options.cellElements[options.cellElements.length - 1].getBoundingClientRect();
|
||||
if (options.type === "select") {
|
||||
|
|
@ -94,7 +94,12 @@ export const openMenuPanel = (options: {
|
|||
window.siyuan.dragElement.style.opacity = "";
|
||||
const sourceElement = window.siyuan.dragElement;
|
||||
window.siyuan.dragElement = undefined;
|
||||
if (options.protyle.disabled) {
|
||||
if (options.protyle && options.protyle.disabled) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return;
|
||||
}
|
||||
if (!options.protyle && window.siyuan.config.readonly) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
return;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue