I want to disable the Aloha Editor sidebar. I've seen the following code in various places, which doesn't work for me:
Aloha.settings = {
sidebar: { disabled: true }
};
If I add it after the call to aloha()
, nothing happens and the sidebar remains. If I add it before I call aloha()
on elements, I get the following error:
Uncaught TypeError: Cannot read property 'getContents' of undefined
All of this is taking place in Aloha.ready
and isn't fixed if I move the code above my call to Aloha.ready
.
If it's helpful, here are the files I'm loading in the <head>
:
<script src=".js"></script>
<script src="//ajax.googleapis/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src=".js" data-aloha-plugins="mon/ui, mon/format, mon/list, mon/link, mon/highlighteditables, mon/horizontalruler, mon/undo, mon/paste"></script>
<link href=".css" rel="stylesheet" type="text/css" />
(I'm currently adding some CSS, which feels wrong. I'd prefer a nicer solution.)
I want to disable the Aloha Editor sidebar. I've seen the following code in various places, which doesn't work for me:
Aloha.settings = {
sidebar: { disabled: true }
};
If I add it after the call to aloha()
, nothing happens and the sidebar remains. If I add it before I call aloha()
on elements, I get the following error:
Uncaught TypeError: Cannot read property 'getContents' of undefined
All of this is taking place in Aloha.ready
and isn't fixed if I move the code above my call to Aloha.ready
.
If it's helpful, here are the files I'm loading in the <head>
:
<script src="http://cdn.aloha-editor/latest/lib/require.js"></script>
<script src="//ajax.googleapis./ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="http://cdn.aloha-editor/latest/lib/aloha.js" data-aloha-plugins="mon/ui, mon/format, mon/list, mon/link, mon/highlighteditables, mon/horizontalruler, mon/undo, mon/paste"></script>
<link href="http://cdn.aloha-editor/latest/css/aloha.css" rel="stylesheet" type="text/css" />
(I'm currently adding some CSS, which feels wrong. I'd prefer a nicer solution.)
Share Improve this question asked Mar 1, 2013 at 23:05 Evan HahnEvan Hahn 12.8k10 gold badges43 silver badges61 bronze badges1 Answer
Reset to default 10Run JS for settings before calling 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>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745453542a4628380.html
评论列表(0条)