Skip to content

Commit

Permalink
fixing bug where old tilegrid was not cleared
Browse files Browse the repository at this point in the history
  • Loading branch information
adkinsrs committed Jan 19, 2024
1 parent f87c6b2 commit 94c15b6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions www/js/classes/tilegrid.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ class TileGrid {
const tilegrid = isMulti ? this.tilegrid.multi : this.tilegrid.single;
const selector = this.selector;

// Clear selector element
document.querySelector(selector).replaceChildren();

// All child tiles fit into a single parent in a vertical sense.
// If "is-vertical" is present, all children tiles will be stacked vertically
// If "tile" class does not have "is-vertical", then children tiles will be stacked horizontally
Expand Down
10 changes: 6 additions & 4 deletions www/js/expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ document.addEventListener('DOMContentLoaded', () => {
});

// add event listener for when the submit-expression-search button is clicked
document.querySelector('#submit-expression-search').addEventListener('click', (event) => {
document.querySelector('#submit-expression-search').addEventListener('click', async (event) => {
// TODO: If I clear the gene symbol search, then click, the gene symbol is not updated and passes validation below - SAdkins

const status = validateExpressionSearchForm();
Expand All @@ -54,9 +54,11 @@ document.addEventListener('DOMContentLoaded', () => {
return;
}

// These can next be wrapped in a Promise.all() call for auto-first-gene selection if we want.
fetchGeneAnnotations();
setupTileGrid(selected_dc_share_id);
try {
await Promise.allSettled([fetchGeneAnnotations(),setupTileGrid(selected_dc_share_id)]);
} catch (error) {
logErrorInConsole(error);
}
});

// handle when the organism-selector select box is changed
Expand Down

0 comments on commit 94c15b6

Please sign in to comment.