Expose internal editor config variable

This commit is contained in:
Yukai Huang 2017-04-09 21:14:23 +08:00
parent db06a51299
commit c6c11c54ef
2 changed files with 4 additions and 4 deletions

View file

@ -78,7 +78,6 @@ import {
import { preventXSS } from './render'
import Editor from './lib/editor'
import EditorConfig from './lib/editor/config'
import getUIElements from './lib/editor/ui-elements'
@ -446,7 +445,7 @@ $(document).ready(function () {
/* we need this only on touch devices */
if (window.isTouchDevice) {
/* cache dom references */
var $body = jQuery('body')
var $body = $('body')
/* bind events */
$(document)
@ -2082,8 +2081,8 @@ socket.on('permission', function (data) {
var permission = null
socket.on('refresh', function (data) {
// console.log(data);
EditorConfig.docmaxlength = data.docmaxlength
editor.setOption('maxLength', EditorConfig.docmaxlength)
editorInstance.config.docmaxlength = data.docmaxlength
editor.setOption('maxLength', editorInstance.config.docmaxlength)
updateInfo(data)
updatePermission(data.permission)
if (!window.loaded) {

View file

@ -119,6 +119,7 @@ export default class Editor {
}
}
this.eventListeners = {}
this.config = config
}
on (event, cb) {