Skip to content

Commit 74938e3

Browse files
committed
- reverting to old code so that sites not in project activity list can be displayed.
1 parent 75e3b64 commit 74938e3

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

grails-app/assets/javascripts/viewModels.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,20 @@ function enmapify(args) {
515515
})[0];
516516
//search from site collection in case it is a private site
517517
if (!matchingSite) {
518-
offlineGetSiteAndAddToSiteList(siteId)
518+
fetchSite(siteId).done(function (result) {
519+
if (result.data) {
520+
var site = result.data;
521+
site.name='Location of the sighting';
522+
sitesObservable.push(site);
523+
matchingSite = site;
524+
map.clearBoundLimits();
525+
map.setGeoJSON(Biocollect.MapUtilities.featureToValidGeoJson(matchingSite.extent.geometry));
526+
// Reassign since siteIdObservable value is cleared when the site is not listed in sitesObservable.
527+
siteIdObservable(siteId);
528+
}
529+
}).fail(function(result) {
530+
console.log(result.message);
531+
});
519532
}
520533

521534
// TODO: OPTIMISE THE PROCEDUE

0 commit comments

Comments
 (0)