summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorYukai Huang2017-04-09 21:14:23 +0800
committerYukai Huang2017-05-07 20:37:27 +0800
commitc6c11c54ef62ed5c87dc7eb8139805a2889cbcc8 (patch)
tree907734b1cd8d7203985026d8cb032485e672c6d0 /public
parentdb06a51299e0888b07062cefd780d514d09ebd37 (diff)
Expose internal editor config variable
Diffstat (limited to '')
-rw-r--r--public/js/index.js7
-rw-r--r--public/js/lib/editor/index.js1
2 files changed, 4 insertions, 4 deletions
diff --git a/public/js/index.js b/public/js/index.js
index 9a8ee11f..d34bfa93 100644
--- a/public/js/index.js
+++ b/public/js/index.js
@@ -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) {
diff --git a/public/js/lib/editor/index.js b/public/js/lib/editor/index.js
index 8cab486c..2991998b 100644
--- a/public/js/lib/editor/index.js
+++ b/public/js/lib/editor/index.js
@@ -119,6 +119,7 @@ export default class Editor {
}
}
this.eventListeners = {}
+ this.config = config
}
on (event, cb) {