javascript - Disable Aloha Editor sidebar - Stack Overflow

I want to disable the Aloha Editor sidebar. I've seen the following code in various places, which

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 badges
Add a ment  | 

1 Answer 1

Reset to default 10

Run 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

相关推荐

  • javascript - Disable Aloha Editor sidebar - Stack Overflow

    I want to disable the Aloha Editor sidebar. I've seen the following code in various places, which

    5小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信