Issue #3177Opened December 9, 2020by anatoli-dp0 reactions

QUESTION/FEATURE REQUEST: Changing Selected Component Tooltip

Question

Is there a way through the api to change the selected component tooltip or is that something that can only be done by editing the source? If so with the api please exlain as I am not bright enough to be able to effectively change the source and every time i try to make other changes I end up with errors when using the modified framework. If not please add this as a feature as This would be extremely useful for certain custom componenets.

Answers (2)

artfDecember 29, 20200 reactions

Hi, when you define a new component, you can customize its toolbar

...
model: {
  defaults: {
    ...
    toolbar: [
      { attributes: { class: 'fa fa-arrow-up' }, command: () => alert('Hi') },
      ...
    ],
  }
}

You can also update the toolbar at runtime in this way:

someComponent.get('toolbar').push({
 attributes: { class: 'fa fa-arrow-up' },
 command: () => alert('Hi')
});

but won't be stored (eg. on a refresh of the page), so I always suggest to think more in a component-oriented way.

anatoli-dpDecember 31, 20200 reactions

Thanks, that is a big help to some of the things i want to add for my own use.

On Tue, Dec 29, 2020 at 1:01 PM Artur Arseniev [email protected] wrote:

Closed #3177 https://github.com/artf/grapesjs/issues/3177.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/artf/grapesjs/issues/3177#event-4155477963, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR4NW5DRZJ57CX6IQR5UQWTSXIRRDANCNFSM4UTXJCQA .

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.