|
@@ -36,19 +36,19 @@ export const setEditMode = (vditor: IVditor, type: string, event: Event | string
|
|
|
vditor.devtools.renderEchart(vditor);
|
|
|
}
|
|
|
if (vditor.preview) {
|
|
|
- if ((vditor.currentPreviewMode === "both" || vditor.currentPreviewMode === "preview") && type === "sv") {
|
|
|
+ if ((vditor.options.preview.mode === "both") && type === "sv") {
|
|
|
vditor.preview.element.style.display = "block";
|
|
|
} else {
|
|
|
vditor.preview.element.style.display = "none";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- enableToolbar(vditor.toolbar.elements, Constants.TOOLBARS);
|
|
|
- removeCurrentToolbar(vditor.toolbar.elements, Constants.TOOLBARS);
|
|
|
+ enableToolbar(vditor.toolbar.elements, Constants.EDIT_TOOLBARS);
|
|
|
+ removeCurrentToolbar(vditor.toolbar.elements, Constants.EDIT_TOOLBARS);
|
|
|
disableToolbar(vditor.toolbar.elements, ["outdent", "indent"]);
|
|
|
|
|
|
if (type === "ir") {
|
|
|
- hideToolbar(vditor.toolbar.elements, ["format", "both", "preview"]);
|
|
|
+ hideToolbar(vditor.toolbar.elements, ["format", "both"]);
|
|
|
showToolbar(vditor.toolbar.elements, ["outdent", "indent", "outline", "insert-before", "insert-after"]);
|
|
|
vditor.irUndo.resetIcon(vditor);
|
|
|
vditor.sv.element.style.display = "none";
|
|
@@ -80,7 +80,7 @@ export const setEditMode = (vditor: IVditor, type: string, event: Event | string
|
|
|
IRHighlightToolbar(vditor);
|
|
|
}
|
|
|
} else if (type === "wysiwyg") {
|
|
|
- hideToolbar(vditor.toolbar.elements, ["format", "both", "preview"]);
|
|
|
+ hideToolbar(vditor.toolbar.elements, ["format", "both"]);
|
|
|
showToolbar(vditor.toolbar.elements, ["outdent", "indent", "outline", "insert-before", "insert-after"]);
|
|
|
vditor.wysiwygUndo.resetIcon(vditor);
|
|
|
vditor.sv.element.style.display = "none";
|
|
@@ -104,16 +104,14 @@ export const setEditMode = (vditor: IVditor, type: string, event: Event | string
|
|
|
}
|
|
|
vditor.wysiwyg.popover.style.display = "none";
|
|
|
} else if (type === "sv") {
|
|
|
- showToolbar(vditor.toolbar.elements, ["format", "both", "preview"]);
|
|
|
+ showToolbar(vditor.toolbar.elements, ["format", "both"]);
|
|
|
hideToolbar(vditor.toolbar.elements, ["outdent", "indent", "outline", "insert-before", "insert-after"]);
|
|
|
vditor.undo.resetIcon(vditor);
|
|
|
vditor.wysiwyg.element.parentElement.style.display = "none";
|
|
|
vditor.ir.element.parentElement.style.display = "none";
|
|
|
- if (vditor.currentPreviewMode === "both") {
|
|
|
+ if (vditor.options.preview.mode === "both") {
|
|
|
vditor.sv.element.style.display = "block";
|
|
|
- } else if (vditor.currentPreviewMode === "preview") {
|
|
|
- vditor.sv.element.style.display = "none";
|
|
|
- } else if (vditor.currentPreviewMode === "editor") {
|
|
|
+ } else if (vditor.options.preview.mode === "editor") {
|
|
|
vditor.sv.element.style.display = "block";
|
|
|
}
|
|
|
vditor.currentMode = "sv";
|