From c11c192d1cf1054055a54ab11d38458022535937 Mon Sep 17 00:00:00 2001 From: Marek Baczynski Date: Wed, 5 Apr 2023 21:25:51 +0200 Subject: [PATCH] fixed issue with being able to add a part to an empty location --- parts/static/script.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/parts/static/script.js b/parts/static/script.js index 267e7fb..045f7f0 100755 --- a/parts/static/script.js +++ b/parts/static/script.js @@ -38,9 +38,10 @@ function new_entry() { $('table#details tr#partno td input').val(''); $('table#details tr#description td input').val(''); $('input[name=datasheet-url-input]').val(''); - // container_onchange(); init_edit(-1); overlay_in(); + container_onchange(); + } function end_edit() { @@ -74,7 +75,7 @@ function end_edit() { } function save(partID) { - if (!$('#location-dropdown').val()) { + if (!$('#location-dropdown').val() || ('#location-dropdown').val()== -1 ) { alert('Please select a location.'); return; } -- 2.39.5