Issue #399Opened October 10, 2017by bungambohlah0 reactions

[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)

artfOctober 10, 20170 reactions

I'd say the correct way to do so is to extend initToolbar() of the Component model and put there you logic

bungambohlahOctober 11, 20170 reactions

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:

bungambohlahOctober 11, 20170 reactions

Sorry i have fixed this with my logic, thank you @artf :+1:

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.