Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML Content ? #166

Open
TheCodemasterZz opened this issue Jun 25, 2022 · 1 comment
Open

HTML Content ? #166

TheCodemasterZz opened this issue Jun 25, 2022 · 1 comment

Comments

@TheCodemasterZz
Copy link

itemAddOptions: { enabled: true, content: '<span class="menu-icon"><span class="svg-icon svg-icon-3"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none"><path opacity="0.3" d="M21 22H14C13.4 22 13 21.6 13 21V3C13 2.4 13.4 2 14 2H21C21.6 2 22 2.4 22 3V21C22 21.6 21.6 22 21 22Z" fill="currentColor"/><path d="M10 22H3C2.4 22 2 21.6 2 21V3C2 2.4 2.4 2 3 2H10C10.6 2 11 2.4 11 3V21C11 21.6 10.6 22 10 22Z" fill="currentColor"/></svg></span></span>', class: 'kanban-title-button btn btn-default btn-xs', footer: false },

is it possible to add html content in itemAddOptions ?

@Scantech-Val
Copy link

By looking at the source code, the problem is that a document.createTextNode is used for the button content, which displays your html like text.
I had a similar problem, the only thing that worked for me was a quick dirty fix --> by modifying the source code to put by default what i wanted in jkanban.js.
At line 346 it put:

if (addButton) {
          var btn = document.createElement('BUTTON')
          var t = document.createTextNode(buttonContent ? buttonContent : '')
          if(!buttonContent){
            btn.innerHTML = '<i class="fa fa-plus"></i>'; // replace with your html content
          }
...

Hope it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants