angular-editor icon indicating copy to clipboard operation
angular-editor copied to clipboard

Please make the toolbar editable

Open elementalTIMING opened this issue 6 years ago • 4 comments

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.

elementalTIMING avatar Aug 30 '19 06:08 elementalTIMING

@elementalPRESS could you show me how you hidden the buttons? I'm trying with angular-editor-toolbar-set but isn't working.

sjmamani avatar Sep 20 '19 14:09 sjmamani

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.

tallestaka avatar Sep 30 '19 13:09 tallestaka

Hi! Try latest version please.

kolkov avatar Nov 13 '19 20:11 kolkov

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:

  1. Improving the toolbarHiddenButtons logic to hide empty sets
  2. Or implementing a cleaner toolbar configuration API

Would welcome a PR for this!

kolkov avatar Nov 22 '25 16:11 kolkov