File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -252,7 +252,7 @@ On the rendered page, the result will look something like this:
252
252
253
253
<ul class =" tags" data-index =" 0" data-prototype =" < ; div> ;< ; label class=" ; required" ;> ; __name__< ; /label> ;< ; div id=" ; task_tags___name__" ;> ;< ; div> ;< ; label for=" ; task_tags___name___name" ; class=" ; required" ;> ; Name< ; /label> ;< ; input type=" ; text" ; id=" ; task_tags___name___name" ; name=" ; task[tags][__name__][name]" ; required=" ; required" ; maxlength=" ; 255" ; /> ;< ; /div> ;< ; /div> ;< ; /div> ; " >
254
254
255
- Now add a button just next to the `` <ul> `` to dynamically add a new tag:
255
+ Now add a button to dynamically add a new tag:
256
256
257
257
.. code-block :: html+twig
258
258
@@ -537,24 +537,24 @@ First, add a "delete this tag" link to each tag form:
537
537
// ...
538
538
539
539
// add a delete link to the new form
540
- addTagFormDeleteLink (item );
540
+ addTagFormDeleteLink (element );
541
541
}
542
542
543
543
The ``addTagFormDeleteLink() `` function will look something like this:
544
544
545
545
.. code-block :: javascript
546
546
547
- const addTagFormDeleteLink = (tagFormLi ) => {
547
+ const addTagFormDeleteLink = (element ) => {
548
548
const removeFormButton = document .createElement (' button' )
549
549
removeFormButton .classList
550
550
removeFormButton .innerText = ' Delete this tag'
551
551
552
- tagFormLi .append (removeFormButton);
552
+ element .append (removeFormButton);
553
553
554
554
removeFormButton .addEventListener (' click' , (e ) => {
555
- e .preventDefault ()
555
+ e .preventDefault ();
556
556
// remove the li for the tag form
557
- tagFormLi .remove ();
557
+ element .remove ();
558
558
});
559
559
}
560
560
You can’t perform that action at this time.
0 commit comments