Skip to content

Commit

Permalink
prf: add JS handling for situations where tables have no rows
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrosquall committed Apr 20, 2023
1 parent 06b4829 commit cf504fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions datasette/static/datasette-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ const datasetteManager = {
renderAboveTablePanel: () => {

const aboveTablePanel = document.querySelector(DOM_SELECTORS.aboveTablePanel);

if (!aboveTablePanel) {
console.warn('This page does not have a table, the renderAboveTablePanel cannot be used.');
}

let aboveTablePanelWrapper = aboveTablePanel.querySelector('.panels');

// First render: create wrappers. Otherwise, reuse previous.
Expand Down

0 comments on commit cf504fe

Please sign in to comment.