6

Is there a way to disable Aloha's ExtJS toolbar in the same way as sidebar?

Aloha.settings =
    modules: ['aloha', 'aloha/jquery']
    editables: '.editable'
    jQuery: $
    sidebar:
        disabled: true
    toolbar:
        disabled: true # does not work

enter image description here

mateusmaso
  • 7,843
  • 6
  • 41
  • 54

3 Answers3

4

You can just hide it with css such as:

div.aloha-toolbar {
    display: none !important;
}
Ryan
  • 7,499
  • 9
  • 52
  • 61
2

There is no easy way to disable the floating menu. You have to disable it by editing the source code you can do this by removing a couple lines. If you comment out line 1207-1210 the floating menu won't show up.

Hope this helps!

albinohrn
  • 626
  • 3
  • 8
  • hmmm, it didnt work.. my application doesnt load floatingmenu.js, but it still shows the toolbar – mateusmaso May 16 '12 at 04:36
  • Then I guess it loads a concatenated version of aloha.js where floatingmenu.js is in included. Then you'll have to find the corresponding lines in that file (or build a new concatenated version with the included build scripts). – albinohrn May 16 '12 at 05:21
  • thanks man, I found it and now it doesnt appears anymore haha.. but do you have any idea how could I fire those toolbar button events programatically? – mateusmaso May 16 '12 at 05:31
  • Have a look at the latest version of [format-plugin.js](https://github.com/alohaeditor/Aloha-Editor/blob/dev/src/plugins/common/format/lib/format-plugin.js#L96), they have added some HotKey-support. – albinohrn May 16 '12 at 06:54
  • 1
    @mateusmaso, You can also invoke the Aloha formatting commands directly. Look at command.js, it provides custom (non-browser) implementations of execCommand queryCommandState etc. One goal of Aloha is to implement a contenteditable API (not just the GUI around it) like http://aryeh.name/spec/editing/editing.html. – Inshallah May 17 '12 at 20:53
2

Mark element with class

<div class="editable notoolbar"></div>

Use event:

Aloha.ready(function () {
    var $ = Aloha.jQuery;
    Aloha.bind('aloha-editable-activated', function () {
        if ($(Aloha.activeEditable.obj[0]).hasClass("notoolbar")) {
            $(".aloha-toolbar").hide();
        }
    });
});
dany
  • 36
  • 2