mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
This commit is contained in:
parent
f5fdab844e
commit
4100f80958
4 changed files with 16 additions and 9 deletions
|
|
@ -22,6 +22,8 @@ import {openAsset} from "../../../editor/util";
|
|||
import {previewImage} from "../../preview/image";
|
||||
import {assetMenu} from "../../../menus/protyle";
|
||||
import {bindViewEvent, getViewHTML} from "./view";
|
||||
import {removeBlock} from "../../wysiwyg/remove";
|
||||
import {getEditorRange} from "../../util/selection";
|
||||
|
||||
export const openMenuPanel = (options: {
|
||||
protyle: IProtyle,
|
||||
|
|
@ -552,15 +554,21 @@ export const openMenuPanel = (options: {
|
|||
avID,
|
||||
id
|
||||
}]);
|
||||
avPanelElement.remove();
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
break;
|
||||
} else if (type === "delete-view") {
|
||||
transaction(options.protyle, [{
|
||||
action: "removeAttrViewView",
|
||||
avID,
|
||||
id: data.viewID
|
||||
}]);
|
||||
if (data.views.length === 1) {
|
||||
removeBlock(options.protyle, options.blockElement, getEditorRange(options.blockElement))
|
||||
} else {
|
||||
transaction(options.protyle, [{
|
||||
action: "removeAttrViewView",
|
||||
avID,
|
||||
id: data.viewID
|
||||
}]);
|
||||
}
|
||||
avPanelElement.remove();
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue