Skip to content

Commit 80e3aee

Browse files
committed
Merge branch 'release/5.2.2'
2 parents 6641b13 + c1b3a94 commit 80e3aee

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed

Diff for: build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ plugins {
2323
// id "com.moowork.node" version "1.1.1"
2424
}
2525

26-
version "5.2.1"
26+
version "5.2.2"
2727
group "au.org.ala"
2828
description "Digivol application"
2929

Diff for: grails-app/views/layouts/digivol-task.gsp

+48
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,20 @@
566566
var elemSelector = '#recordValues\\.' + recordIdx + '\\.recordedByID';
567567
$(elemSelector).val(item.key).attr('collector_name', item.name);;
568568
}
569+
} else if (fieldName == 'occurrenceDetails') {
570+
var matches = $(this).attr("id").match(/^recordValues[.](\d+)[.]occurrenceDetails$/);
571+
if (matches.length > 0) {
572+
var recordIdx = matches[1];
573+
var elemSelector = '#recordValues\\.' + recordIdx + '\\.occurrenceID';
574+
$(elemSelector).val(item.key).attr('collector_name', item.name);;
575+
}
576+
} else if (fieldName == 'verbatimLocality') {
577+
var matches = $(this).attr("id").match(/^recordValues[.](\d+)[.]verbatimLocality$/);
578+
if (matches.length > 0) {
579+
var recordIdx = matches[1];
580+
var elemSelector = '#recordValues\\.' + recordIdx + '\\.verbatimLocalityID';
581+
$(elemSelector).val(item.key).attr('collector_name', item.name);;
582+
}
569583
}
570584
},
571585
source: function(request, response) {
@@ -617,6 +631,40 @@
617631
}
618632
});
619633

634+
$("input.occurrenceDetails").blur(function(e) {
635+
// If the value of the occurrenceDetails field does not match the name in the collector_name attribute
636+
// of the occurrenceID element it means that the collector name no longer matches the id, so the id
637+
// must be cleared.
638+
var matches = $(this).attr("id").match(/^recordValues[.](\d+)[.]occurrenceDetail$/);
639+
var value = $(this).val();
640+
if (matches.length > 0) {
641+
var recordIdx = matches[1];
642+
var elemSelector = '#recordValues\\.' + recordIdx + '\\.occurrenceID';
643+
var collectorName = $(elemSelector).attr("collector_name");
644+
if (value != collectorName) {
645+
$(elemSelector).val('');
646+
$(elemSelector).attr("collector_name", "");
647+
}
648+
}
649+
});
650+
651+
$("input.verbatimLocality").blur(function(e) {
652+
// If the value of the verbatimLocality field does not match the name in the collector_name attribute
653+
// of the verbatimLocalityID element it means that the collector name no longer matches the id, so the id
654+
// must be cleared.
655+
var matches = $(this).attr("id").match(/^recordValues[.](\d+)[.]verbatimLocality$/);
656+
var value = $(this).val();
657+
if (matches.length > 0) {
658+
var recordIdx = matches[1];
659+
var elemSelector = '#recordValues\\.' + recordIdx + '\\.verbatimLocalityID';
660+
var collectorName = $(elemSelector).attr("collector_name");
661+
if (value != collectorName) {
662+
$(elemSelector).val('');
663+
$(elemSelector).attr("collector_name", "");
664+
}
665+
}
666+
});
667+
620668
}
621669

622670
function disableSection(classSelector) {

0 commit comments

Comments
 (0)