Skip to content

Commit

Permalink
yarn prettier for add-item.js
Browse files Browse the repository at this point in the history
  • Loading branch information
dsrink authored and Stefan Rink committed Dec 29, 2023
1 parent 0ea15e2 commit 0d4b6a6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions war/src/main/js/add-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,12 +335,14 @@ $.when(getItems()).done(function (data) {
activateValidationMessage("#itemname-required", ".add-item-name");
setTimeout(function () {
var parentName = $('input[name="from"]', "#createItem").val();
$.get("job/" + parentName + "/api/json?tree=name").done(function (data) {
if (data.name === parentName) {
//if "name" is invalid, but "from" is a valid job, then switch focus to "name"
$('input[name="name"][type="text"]', "#createItem").focus();
}
})
$.get("job/" + parentName + "/api/json?tree=name").done(
function (data) {
if (data.name === parentName) {
//if "name" is invalid, but "from" is a valid job, then switch focus to "name"
$('input[name="name"][type="text"]', "#createItem").focus();
}
},
);
}, 400);
} else {
if (getFormValidationStatus()) {
Expand Down

0 comments on commit 0d4b6a6

Please sign in to comment.