datatracker/ietf/static/js/status-change-edit-relations.js
Lars Eggert 37cb737987 Check the selenium console log for any issues as part of the test suite,
and fix/suppress errors found by that.
 - Legacy-Id: 19916
2022-02-10 21:20:20 +00:00

32 lines
1,001 B
JavaScript

$(document)
.ready(function () {
var form = $(".new-relation-row")
.closest("form");
var newRowHtml = form.find(".new-relation-row")
.get(0)
.outerHTML;
var counter = 1;
form.on("click", ".delete", function (e) {
e.preventDefault();
$(this)
.closest(".input-group")
.remove();
});
form.on("keydown", ".new-relation-row input[type=text]", function () {
var top = $(this)
.closest(".new-relation-row");
top.removeClass("new-relation-row");
top.find(".delete")
.prop('Disabled', false)
.removeClass("btn-outline-danger")
.addClass("btn-danger");
top.find("input,select")
.each(function () {
this.name += counter;
});
++counter;
top.after(newRowHtml);
});
});