Skip to content

Commit

Permalink
FormControls clean up output from whitespace and newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRDOrazio committed Apr 29, 2024
1 parent 73ff113 commit 6acc26a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
6 changes: 3 additions & 3 deletions assets/js/FormControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class FormControls {
formRow += `</div>`;
++FormControls.uniqid;

return formRow;
return formRow.replaceAll(' ','').replace(/(?:\r\n|\r|\n)/g,'');
}

static CreatePatronRow(element = null) {
Expand Down Expand Up @@ -266,7 +266,7 @@ class FormControls {
formRow += `</div>`;
++FormControls.uniqid;

return formRow;
return formRow.replaceAll(' ','').replace(/(?:\r\n|\r|\n)/g,'');
}

static CreateDoctorRow(element = null) {
Expand Down Expand Up @@ -444,7 +444,7 @@ class FormControls {
formRow += `</div>`;
++FormControls.uniqid;

return formRow;
return formRow.replaceAll(' ','').replace(/(?:\r\n|\r|\n)/g,'');
}

}
Expand Down
9 changes: 2 additions & 7 deletions assets/js/extending.js
Original file line number Diff line number Diff line change
Expand Up @@ -684,9 +684,6 @@ $(document).on('click', '.actionPromptButton', ev => {

if( existingFestivityTag !== '' ) {
rowStr = FormControls.CreatePatronRow( existingFestivityTag );
rowStr = rowStr.replaceAll(' ','');
rowStr = rowStr.replace(/(?:\r\n|\r|\n)/g,'');
console.log(rowStr);
rowEls = $.parseHTML(rowStr);
$row = $( rowEls );
console.log($row);
Expand All @@ -696,8 +693,6 @@ $(document).on('click', '.actionPromptButton', ev => {
}
} else {
rowStr = FormControls.CreatePatronRow();
rowStr = rowStr.replaceAll(' ','');
rowStr = rowStr.replace(/(?:\r\n|\r|\n)/g,'');
rowEls = $.parseHTML( rowStr );
$row = $( rowEls );
}
Expand Down Expand Up @@ -811,8 +806,8 @@ $(document).on('change', '.regionalNationalCalendarName', ev => {
}

let rowStr = FormControls.CreatePatronRow( el );
console.log(rowStr);
let $row = $(rowStr);
let rowEls = $.parseHTML(rowStr);
let $row = $(rowEls);
$('.regionalNationalDataForm').append($row);

let $formrow = $row.find('.form-group').closest('.row');
Expand Down

0 comments on commit 6acc26a

Please sign in to comment.