Commit 02ec44e8 authored by Ryan Herbert's avatar Ryan Herbert
Browse files

add delete button to set tokens

so we can remove tokens if a mistake is made.
parent 23a3ac0d
......@@ -56,7 +56,11 @@ Tokeniser.prototype = {
var set_id = $(input).data('set-id');
var className = "set_token " + class_mapping[set_id.substr(0, 2)];
token.className = className;
token.innerText = text;
var x = document.createElement('i');
x.className = "icon-cancel";
x.onclick = function() {this.parentNode.parentNode.removeChild(this.parentNode);};
token.appendChild(x);
token.appendChild(document.createTextNode(text));
$(token).data('set-id', set_id);
$(input).val("");
$(input).data('set-id');
......
......@@ -80,7 +80,10 @@
size="80">
<br>
{{ for set in sets: }}
<span class="set_token {{=set['type']}}_token" data-set-id="{{=set['id']}}">{{=set['id'][3:]}}</span>
<span class="set_token {{=set['type']}}_token" data-set-id="{{=set['id']}}">
<i class="icon-cancel" onclick="this.parentNode.parentNode.removeChild(this.parentNode);"></i>
{{=set['id'][3:]}}
</span>
{{pass}}
</div>
</td>
......
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