Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
gruberroland committed Jan 12, 2024
1 parent 05853e4 commit 7b9d3d9
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lam/templates/lib/500_lam.js
Original file line number Diff line number Diff line change
Expand Up @@ -2724,13 +2724,12 @@ window.lam.treeview.clearValue = function (event, link) {
*/
window.lam.treeview.addValue = function (event, link) {
event.preventDefault();
var linkObj = jQuery(link);
var parentTr = jQuery(linkObj.parents('tr').get(0));
var newTr = parentTr.clone();
var newField = newTr.find('input, textarea');
newField.val('');
newField.attr('data-value-orig', '');
newTr.insertAfter(parentTr);
const parentTr = link.closest('tr');
const newTr = parentTr.clone();
const newField = newTr.querySelector('input, textarea');
newField.value = '';
newField.dataset.valueOrig = '';
newTr.append(parentTr);
}

/**
Expand Down

0 comments on commit 7b9d3d9

Please sign in to comment.