Skip to content

Commit

Permalink
[Backport 3.2.x][Fixes #7034] Metadata UI freezes on empty mandatory …
Browse files Browse the repository at this point in the history
…fields (#7072)

* [Fixes: #7034] Metadata UI freezes on empty mandatory fields

* [Fixes #7034] Metadata UI freezes on empty mandatory fields

* [Fixes #7034] Metadata UI freezes on empty mandatory fields
  • Loading branch information
mattiagiupponi authored Mar 12, 2021
1 parent fae4f80 commit 6d46f70
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions geonode/templates/metadata_form_js.html
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,12 @@
$('#category_form').change(onInputChange).change();
$('#id_resource-group').change(onInputChange).change();

document.querySelector('select[name="resource-keywords"]').onchange=onInputChange

$( ':input[id*="id_tkeywords"][required]:visible').each( function () {
$('#' + this.id).change(onInputChange).change();
});

document.querySelector('select[name="resource-keywords"]').onchange=onInputChange

$('#id_resource-regions').change(onInputChange).change();
$('#id_resource-temporal_extent_end').on('blur', function() {$(this).change(onInputChange).change();})
$('#id_resource-temporal_extent_start').on('blur', function() {$(this).change(onInputChange).change();})
Expand Down Expand Up @@ -501,9 +501,8 @@
});

function validateRequiredInput() {
const required_inputs = $(':input[required]:visible')
var errors = []
$( ':input[required]:visible').each( function () {
$( ':input[required]').each( function () {
if ( this.value.trim() == '' ) {
errors.push(this.id)
}
Expand Down

0 comments on commit 6d46f70

Please sign in to comment.