using immediately invoked function expression Signed-off-by: Julian Maurice <julian.maurice@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
40 lines
No EOL
1 KiB
JavaScript
40 lines
No EOL
1 KiB
JavaScript
(function () {
|
|
$(document).ready(function () {
|
|
$("#additional_fields_form_section").on(
|
|
"click",
|
|
".clone_attribute",
|
|
function (e) {
|
|
e.preventDefault();
|
|
clone_entry(this);
|
|
}
|
|
);
|
|
|
|
$("#additional_fields_form_section").on(
|
|
"click",
|
|
".clear_attribute",
|
|
function (e) {
|
|
e.preventDefault();
|
|
clear_entry(this);
|
|
}
|
|
);
|
|
|
|
$("#additional_fields_form_section")
|
|
.parents("form ")
|
|
.submit(function () {
|
|
$(".marcfieldget").prop("disabled", false);
|
|
return true;
|
|
});
|
|
});
|
|
|
|
function clone_entry(node) {
|
|
var original = $(node).parent();
|
|
var clone = $(node).parent().clone();
|
|
$(original).after(clone);
|
|
return false;
|
|
}
|
|
|
|
function clear_entry(node) {
|
|
var original = $(node).parent();
|
|
$("input", original).val("");
|
|
}
|
|
})(); |