Skip to content

Commit c6c11c5

Browse files
committed
Expose internal editor config variable
1 parent db06a51 commit c6c11c5

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

public/js/index.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ import {
7878
import { preventXSS } from './render'
7979

8080
import Editor from './lib/editor'
81-
import EditorConfig from './lib/editor/config'
8281

8382
import getUIElements from './lib/editor/ui-elements'
8483

@@ -446,7 +445,7 @@ $(document).ready(function () {
446445
/* we need this only on touch devices */
447446
if (window.isTouchDevice) {
448447
/* cache dom references */
449-
var $body = jQuery('body')
448+
var $body = $('body')
450449

451450
/* bind events */
452451
$(document)
@@ -2082,8 +2081,8 @@ socket.on('permission', function (data) {
20822081
var permission = null
20832082
socket.on('refresh', function (data) {
20842083
// console.log(data);
2085-
EditorConfig.docmaxlength = data.docmaxlength
2086-
editor.setOption('maxLength', EditorConfig.docmaxlength)
2084+
editorInstance.config.docmaxlength = data.docmaxlength
2085+
editor.setOption('maxLength', editorInstance.config.docmaxlength)
20872086
updateInfo(data)
20882087
updatePermission(data.permission)
20892088
if (!window.loaded) {

public/js/lib/editor/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ export default class Editor {
119119
}
120120
}
121121
this.eventListeners = {}
122+
this.config = config
122123
}
123124

124125
on (event, cb) {

0 commit comments

Comments
 (0)