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)
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.
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.
Issue #2300
[QUESTIONS] How to change order of categories?
I saw the changes done by @JuanTincho of adding the "Order" attibute but I was able of adding it only on new categories created. I started...
Issue #2404
Question: how to observe children changes in component
Is there an easy way to subscribe/listen to changes in the components/children of my custom component type? Perhaps an event I can subscrib...
Issue #1262
Editable Cell
Hello, I am using GrapesJS for newsletters (with the gjs-preset-newsletter plugin) and i have a problem when I import code. I can't edit th...
Issue #2433
[Bug] Changing layerable in an an event at runtime doesn't immediately update
When I change the layerable option of a custom component in an event, it still shows up in the layers until you drag it once. Is there some...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.