Customize the Edit Button for ContentTools

I find it hard to understand how I can change the appearance and / or position of the Ignition button in ContentTools (wysiwyg editor).

I found out that I can use editor.start(); and editor.stop(); to invoke page editing, and I would like to map this function to my own buttons, but I cannot get rid of the default button.

The documentation and tutorials on their website did not help me figure this out.

Thanks!

+6
source share
1 answer

There are two ways that I recommend doing, the easiest option is to hide the ignition button (as it is called) ( SASS link ):

 .ct-ignition { display: none; } 

If you prefer to completely remove a button from the DOM, you can disable this button from the user interface ( CoffeeScript link ):

 // Once the Editor has been initialized ContentTools.EditorApp.get()._ignition.unmount(); 

My advice would be to use CSS to hide the ignition and trigger events against it to trigger the functionality manually through your custom button, for example:

 var editor = ContentTools.EditorApp.get(); // Starting the editor manually editor._ignition.trigger('start'); // Stoping the editor manually (save) editor._iginition.trigger('stop', true); // Stoping the editor manually (cancel) editor._iginition.trigger('stop', false); 

It may also be useful to look at these questions asked in the github project list:

+6
source

All Articles