Commit 1d2eab5f authored by Junghyun Kim's avatar Junghyun Kim

Allow show/hide delete button using DOM attribute

Someone wants to hide delete buttons in some cases.
To do this easily, we need a special attribute 'data-allow-delete'
in `input` tag.

You can use this like below:
`<input type='tags' data-allow-delete='true' value='tag1,tag2'>`
Signed-off-by: default avatarJunghyun Kim <kjhman21@gmail.com>
parent b9ffb143
......@@ -49,6 +49,8 @@ export default class Tagify {
duplicates: true
}
this.element = element;
if( element.getAttribute("data-allow-delete") )
defaultOptions.allowDelete = element.getAttribute("data-allow-delete") == 'true';
this.options = Object.assign({}, defaultOptions, options);
this.init();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment