Skip to content

Commit

Permalink
fix: #650 switchModel()API切换预览模式时隐藏工具栏
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Nov 21, 2023
1 parent cdff504 commit b573fd3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Cherry.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export default class Cherry extends CherryStatic {
if (this.toolbar) {
this.toolbar.showToolbar();
}
this.wrapperDom.classList.remove('cherry--no-toolbar');
break;
case 'editOnly':
if (!this.previewer.isPreviewerHidden()) {
Expand All @@ -211,10 +212,12 @@ export default class Cherry extends CherryStatic {
if (this.toolbar) {
this.toolbar.showToolbar();
}
this.wrapperDom.classList.remove('cherry--no-toolbar');
break;
case 'previewOnly':
this.previewer.previewOnly();
this.toolbar && this.toolbar.previewOnly();
this.wrapperDom.classList.add('cherry--no-toolbar');
break;
}
}
Expand Down

0 comments on commit b573fd3

Please sign in to comment.