[Question] Can i push toolbar in current modal and current modal child?
Question
Hello again @artf , i confuse about push toolbar in the element with specific class (ex: modal-trigger)
the element code is :
...
<a href="#modal1" data-highlightable="1" class="modal-trigger">
<div data-highlightable="1" class="card">
<div data-highlightable="1" class="card-image waves-effect waves-block waves-light">
<img src="images/facilities1.jpg" class="activator" onmousedown="return false">
</div>
<div data-highlightable="1" class="card-content">Afternoon High Tea in the Beach</div>
</div>
</a>
...
and in the /src/dom_components/model/Component.js
...
for( var i = 0, len = model.get("classes").models.length; i < len; i++ ) {
if( model.get("classes").models[i].attributes.name == 'modal-trigger' ) {
findModalTrigger = model.get("classes").models[i];
break;
}
}
// if current model has class
if(findModalTrigger != null) {
tb.push({
attributes: {class: 'fa fa-window-maximize'},
command: 'tlb-show-modal',
});
...
as you can see, the element to push toolbar just in tag <a> element, and can i push toolbar to all element inside <a> ?
Thank you and sorry for my bad explanation
Answers (3)
I'd say the correct way to do so is to extend initToolbar() of the Component model and put there you logic
I'd say the correct way to do so is to extend
initToolbar()of the Component model
Of course, i make my custom toolbar in initToolbar() method
and please @artf can you explain about the logic to push the toolbar in the child object? i confuse about the backbone structure :confused: Thank you before :+1:
Sorry i have fixed this with my logic, thank you @artf :+1:
Related Questions and Answers
Continue research with similar issue discussions.
Issue #363
[QUESTION] How to get child object ?
Hi @artf i want to ask about get some child from current model, let's say in that source code, can i get child object like get parent objec...
Issue #345
[QUESTION] How to open Materialize modal from my custom command src/commands/index.js ?
Hello @artf , nice to see you again, i have a question, how to initialize materializecss modal from source code commands grapesjs? , let's...
Issue #1978
[Bug]: Styles allways applied to classes
Hello, I have a Problem with styling individual Items. The following html Code: Loads fine. But when I Click the Component with "#icbp" the...
Issue #1817
Change HTML content while block is render in editor
Hello @artf I have one block into block manager like As per above script inside the block, i want to add dynamic HTML content while this bl...
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.