禁用Aloha Editor侧栏

Eva*_*ahn 2 javascript aloha-editor

我想禁用Aloha Editor侧栏.我在各个地方看过以下代码,这对我不起作用:

Aloha.settings = {
  sidebar: { disabled: true }
};
Run Code Online (Sandbox Code Playgroud)

如果我在调用添加它aloha(),没有任何反应,侧边栏仍然存在.如果我调用aloha()元素之前添加它,我会收到以下错误:

Uncaught TypeError: Cannot read property 'getContents' of undefined
Run Code Online (Sandbox Code Playgroud)

Aloha.ready如果我将代码移到我的调用之上,所有这一切都发生在并且没有修复Aloha.ready.

如果它有用,这里是我正在加载的文件<head>:

<script src="http://cdn.aloha-editor.org/latest/lib/require.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://cdn.aloha-editor.org/latest/lib/aloha.js" data-aloha-plugins="common/ui, common/format, common/list, common/link, common/highlighteditables, common/horizontalruler, common/undo, common/paste"></script>
<link href="http://cdn.aloha-editor.org/latest/css/aloha.css" rel="stylesheet" type="text/css" />
Run Code Online (Sandbox Code Playgroud)

(我现在正在添加一些CSS,感觉不对.我更喜欢更好的解决方案.)

Mar*_*ski 10

调用之前运行JS进行设置aloha.js:

<script>
Aloha = {};
Aloha.settings = { sidebar: { disabled: true } };
</script>
<script src="aloha/lib/vendor/require.js"></script>
<script src="aloha/lib/aloha.js"></script>
Run Code Online (Sandbox Code Playgroud)