fix: 更新编辑器

This commit is contained in:
WuHao 2021-08-28 09:10:56 +08:00
parent 633cbb7544
commit 11feae3439
5 changed files with 30 additions and 30 deletions

File diff suppressed because one or more lines are too long

View File

@ -121,7 +121,7 @@ body.fullscreen {
min-height: 0;
display: flex;
width: 100%;
.cm-wrap {
.cm-editor {
flex-shrink: 0;
flex: 1;
min-width: 0;

File diff suppressed because one or more lines are too long

View File

@ -2,20 +2,20 @@ import { undo, redo } from '@codemirror/history';
export default class JoeAction {
constructor() {
$('body').append(`
<div class="cm-modal">
<div class="cm-modal__wrapper">
<div class="cm-modal__wrapper-header">
<div class="cm-modal__wrapper-header--text"></div>
<div class="cm-modal__wrapper-header--close">×</div>
</div>
<div class="cm-modal__wrapper-bodyer"></div>
<div class="cm-modal__wrapper-footer">
<button class="cm-modal__wrapper-footer--cancle">取消</button>
<button class="cm-modal__wrapper-footer--confirm">确定</button>
</div>
</div>
</div>
`);
<div class="cm-modal">
<div class="cm-modal__wrapper">
<div class="cm-modal__wrapper-header">
<div class="cm-modal__wrapper-header--text"></div>
<div class="cm-modal__wrapper-header--close">×</div>
</div>
<div class="cm-modal__wrapper-bodyer"></div>
<div class="cm-modal__wrapper-footer">
<button class="cm-modal__wrapper-footer--cancle">取消</button>
<button class="cm-modal__wrapper-footer--confirm">确定</button>
</div>
</div>
</div>
`);
$('.cm-modal__wrapper-footer--cancle, .cm-modal__wrapper-header--close').on('click', () => $('.cm-modal').removeClass('active'));
$('.cm-modal__wrapper-footer--confirm').on('click', () => {
this.options.confirm();
@ -27,8 +27,8 @@ export default class JoeAction {
title: '提示',
innerHtml: '内容',
hasFooter: true,
confirm: () => {},
handler: () => {}
confirm: () => { },
handler: () => { }
};
this.options = Object.assign(_options, options);
$('.cm-modal__wrapper-header--text').html(this.options.title);

View File

@ -3,19 +3,19 @@
"serve": "rollup -c -w"
},
"dependencies": {
"@codemirror/closebrackets": "^0.18.0",
"@codemirror/commands": "^0.18.3",
"@codemirror/highlight": "^0.18.4",
"@codemirror/history": "^0.18.1",
"@codemirror/lang-markdown": "^0.18.4",
"@codemirror/language-data": "^0.18.0",
"@codemirror/matchbrackets": "^0.18.0",
"@codemirror/state": "^0.18.7",
"@codemirror/view": "^0.18.18"
"@codemirror/closebrackets": "^0.19.0",
"@codemirror/commands": "^0.19.2",
"@codemirror/highlight": "^0.19.2",
"@codemirror/history": "^0.19.0",
"@codemirror/lang-markdown": "^0.19.1",
"@codemirror/language-data": "^0.19.0",
"@codemirror/matchbrackets": "^0.19.1",
"@codemirror/state": "^0.19.1",
"@codemirror/view": "^0.19.3"
},
"devDependencies": {
"@rollup/plugin-node-resolve": "^13.0.0",
"rollup": "^2.52.8",
"@rollup/plugin-node-resolve": "^13.0.4",
"rollup": "^2.56.3",
"rollup-plugin-terser": "^7.0.2"
}
}