Skip to content

Commit

Permalink
丰富公式相关的配置
Browse files Browse the repository at this point in the history
  • Loading branch information
sunsonliu committed Aug 24, 2023
1 parent e01cc84 commit 811df25
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
7 changes: 7 additions & 0 deletions src/Cherry.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,13 @@ const defaultConfig = {
// 'Ctrl-b': 'bold',
// 'Ctrl-Alt-m': 'formula',
},
// 一些按钮的配置信息
config: {
formula: {
showLatexLive: true, // true: 显示 www.latexlive.com 外链; false:不显示
templateConfig: false, // false: 使用默认模板
},
},
},
// 打开draw.io编辑页的url,如果为空则drawio按钮失效
drawioIframeUrl: '',
Expand Down
19 changes: 12 additions & 7 deletions src/toolbars/BubbleFormula.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/toolbars/hooks/Formula.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default class Formula extends MenuBase {
constructor($cherry) {
super($cherry);
this.setName('formula', 'insertFormula');
this.subBubbleFormulaMenu = new BubbleFormula($cherry?.options?.engine?.syntax?.formula?.config || {});
this.subBubbleFormulaMenu = new BubbleFormula($cherry?.options?.toolbars?.config?.formula);
$cherry.editor.options.wrapperDom.appendChild(this.subBubbleFormulaMenu.dom);
this.catchOnce = '';
}
Expand Down
2 changes: 2 additions & 0 deletions types/cherry.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,8 @@ export interface CherryToolbarOptions {
customMenu?: Record<string, any>;
/** 自定义快捷键 */
shortcutKey?: Object | false;
/** 一些按钮的配置信息 */
config?: Object;
}

export interface CherryFileUploadHandler {
Expand Down

0 comments on commit 811df25

Please sign in to comment.