Please make the toolbar editable
I really love your editor. But a feature to define which buttons are visible or hidden is really missing!
Of course it's possible to hide single buttons via CSS but the problem is that you have defined several important style notes in the upper class angular-editor-toolbar-set. So you can remove a button, but when a complete set is empty (doesn't contain any buttons) a border pixel and the margins remain visible.
I don't think it is a good solution to hide those elements via CSS nth-element etc., but it's a job of configuration of the editor. It would be really awesome to have the ability to configure the toolbar in this way.
@elementalPRESS could you show me how you hidden the buttons? I'm trying with angular-editor-toolbar-set but isn't working.
In the HTML file put an id in editor like this: <angular-editor id="commentsEditor"
In CSS file i'm using this:
angular-editor#commentsEditor .angular-editor-button[title="Insert Image"] { display: none; }
You can change the button, just change the title.
Hi! Try latest version please.
Great suggestion! This is actually already partially supported.
Current solution - Hide individual buttons:
editorConfig: AngularEditorConfig = {
editable: true,
enableToolbar: true,
showToolbar: true,
toolbarHiddenButtons: [
['bold', 'italic'], // Hide from first toolbar set
['fontSize', 'textColor'] // Hide from second toolbar set
]
};
However, you're right - there's a styling issue when entire sets become empty (borders/margins remain visible).
Workaround for now:
// Hide empty toolbar sets
angular-editor-toolbar-set:empty {
display: none;
}
Feature request: A cleaner API to show/hide toolbar buttons without manual CSS would be valuable:
// Proposed API
toolbar: {
formatting: ['bold', 'italic', 'underline'],
lists: ['orderedList', 'unorderedList'],
links: ['link', 'unlink'],
// ... etc
}
This would render only the specified buttons and hide empty sets automatically.
Keeping this open as a valid enhancement request. Labeling as enhancement and good first issue - the fix involves:
- Improving the
toolbarHiddenButtonslogic to hide empty sets - Or implementing a cleaner
toolbarconfiguration API
Would welcome a PR for this!