Skip to content

Commit

Permalink
/deploy sit
Browse files Browse the repository at this point in the history
  • Loading branch information
jbyrne committed Jul 10, 2024
1 parent 2e1e859 commit 927cca1
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/jpl/dijit/GranulesController.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ define([
_granuleSearchInProgress: false,
loadingGranulesMessage: '<div class="granulesControllerLoadingGranulesMessage">Loading Granules...</div>',
noGranulesMessage: '<div class="granulesControllerNoDataMessage">No Granules Found</div>',
scrollLoadInProgress: false,

constructor: function() {
this.datasetVariables = {};
Expand Down Expand Up @@ -757,7 +758,18 @@ define([
stateStoreItemsToRemove.push((currentStateStore[j]))
}
}

// if scroll, don't remove
if(!this.scrollLoadInProgress) {
for(var k=0; k<stateStoreItemsToRemove.length; k++) {
_context.stateStore.remove(stateStoreItemsToRemove[k]["Granule-Id"])
topic.publish(GranuleSelectionEvent.prototype.REMOVE_GRANULE_FOOTPRINT, {
granuleObj: stateStoreItemsToRemove[k]
});
topic.publish(GranuleSelectionEvent.prototype.REMOVE_GRANULE_PREVIEW, {
granuleObj: stateStoreItemsToRemove[k]
});
}
}
// clear anything from state store that is not a concept id in the response items
response.items.map(function(x) {
GranuleMetadata.convertFootprintAndImageFromCMR(x);
Expand Down Expand Up @@ -830,6 +842,9 @@ define([
// Show spinner
this.displayLoadingSpinner(false);

// set scroll back to false
this.scrollLoadInProgress = false;

},

filterGranules: function() {
Expand Down Expand Up @@ -884,6 +899,7 @@ define([
// First approach, fetch more if scroll pos is 90% of way down
if ((scrollPosTop + offsetHeight) / scrollHeight > 0.90) {
this.currentSolrIdx += this.itemsPerPage;
this.scrollLoadInProgress = true;
this.fetchGranules();
}
},
Expand Down

0 comments on commit 927cca1

Please sign in to comment.