jerosoler / Drawflow

Simple flow library 🖥️🖱️
https://jerosoler.github.io/Drawflow/
MIT License
4.78k stars 741 forks source link

How to add icons to title-box #395

Closed pkasson closed 2 years ago

pkasson commented 2 years ago

Related to #80 , I have created a context / right click for the nodes where a menu pops for edit/delete.

I could not get the icons to show properly as shown in #80 ... any ideas on how to inline font-awesome or other icons on same line as text for the title-box ?

jerosoler commented 2 years ago

In the template:

 var template = `
          <div>
            <div class="title-box">Title <div class="icons"><i class="fab fa-edit "><i class="fab fa-delete "></div></div>
            <div class="box">
              ...
            </div>
          </div>
          `;
          editor.addNode('node', 0, 1, pos_x, pos_y, 'node', { "name": ''}, template );
shehab-01 commented 9 months ago

I wrote exactly as you showed but couldn't get desired result.

1
jerosoler commented 9 months ago

@shehab-01 revise your css or add an image instead of an icon