Commit a05a9ab0 authored by Ryan Herbert's avatar Ryan Herbert

form_builder.js remove index decrementation.

It was only working when deleting the last element from the list, and
was causing issues when deleting from the middle of the form.
See #3491
parent 3be3ceb1
......@@ -187,7 +187,6 @@ PatientFormBuilder.prototype.createCloseButton = function() {
var close = Object.getPrototypeOf(PatientFormBuilder.prototype).createCloseButton.call(this);
$(close).click(function() {
var button = document.getElementById('patient_button');
button.dataset.index --;
});
return close;
};
......@@ -219,7 +218,6 @@ RunFormBuilder.prototype.createCloseButton = function() {
var close = Object.getPrototypeOf(RunFormBuilder.prototype).createCloseButton.call(this);
$(close).click(function() {
var button = document.getElementById('run_button');
button.dataset.index--;
});
return close;
};
......@@ -247,7 +245,6 @@ GenericFormBuilder.prototype.createCloseButton = function() {
var close = Object.getPrototypeOf(GenericFormBuilder.prototype).createCloseButton.call(this);
$(close).click(function() {
var button = document.getElementById('generic_button');
button.dataset.index--;
});
return close;
};
......@@ -390,7 +387,6 @@ FileFormBuilder.prototype.createCloseButton = function() {
var close = Object.getPrototypeOf(FileFormBuilder.prototype).createCloseButton.call(this);
$(close).click(function() {
var button = document.getElementById('file_button');
button.dataset.index--;
});
return close;
}
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