Add remove_specific_synonym_form.

This commit is contained in:
voussoir 2020-09-14 17:19:25 -07:00
parent 5501f7279b
commit 0f039c5c48

View file

@ -241,7 +241,7 @@ h2, h3
{{tag_object.tag_object(specific_tag, link=none, innertext=synonym)-}}
<button
class="remove_tag_button red_button button_with_confirm"
data-onclick="return api.tags.remove_synonym('{{specific_tag.name}}', '{{synonym}}', tag_action_callback);"
data-onclick="return remove_specific_synonym_form(event);"
data-prompt="Remove Synonym?"
data-confirm="Remove"
data-confirm-class="remove_tag_button_perm red_button"
@ -315,6 +315,13 @@ function remove_child_form(event)
return api.tags.remove_child(parent_name, tag_name, tag_action_callback);
}
function remove_specific_synonym_form(event)
{
const delete_button = event.target;
const li = delete_button.closest("li");
const tag_object = tag_object_from_li(li);
const synonym = tag_object.innerText;
return api.tags.remove_synonym(SPECIFIC_TAG, synonym, tag_action_callback);
}
function remove_synonym_form(event)