Javascript 禁用Aloha编辑器侧栏

Javascript 禁用Aloha编辑器侧栏,javascript,aloha-editor,Javascript,Aloha Editor,我想禁用侧边栏。我在不同的地方看到了以下代码,但这些代码对我来说并不适用: Aloha.settings = { sidebar: { disabled: true } }; 如果我在调用aloha()之后添加它,则不会发生任何事情,侧边栏也会保留。如果在对元素调用aloha()之前添加它,则会出现以下错误: Uncaught TypeError: Cannot read property 'getContents' of undefined 所有这些都发生在Aloha.ready中,如

我想禁用侧边栏。我在不同的地方看到了以下代码,但这些代码对我来说并不适用:

Aloha.settings = {
  sidebar: { disabled: true }
};
如果我在调用
aloha()
之后添加它,则不会发生任何事情,侧边栏也会保留。如果在对元素调用
aloha()
之前添加它,则会出现以下错误:

Uncaught TypeError: Cannot read property 'getContents' of undefined
所有这些都发生在
Aloha.ready
中,如果我将代码移到调用上方的
Aloha.ready
中,则不会修复

如果有帮助,以下是我在
中加载的文件:



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

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

<script>
Aloha = {};
Aloha.settings = { sidebar: { disabled: true } };
</script>
<script src="aloha/lib/vendor/require.js"></script>
<script src="aloha/lib/aloha.js"></script>

Aloha={};
Aloha.settings={sidebar:{disabled:true}};
<script>
Aloha = {};
Aloha.settings = { sidebar: { disabled: true } };
</script>
<script src="aloha/lib/vendor/require.js"></script>
<script src="aloha/lib/aloha.js"></script>