Skip to content

Commit

Permalink
Pass element and file index to tableBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
tomodwyer committed Nov 3, 2023
1 parent b963897 commit e131ba0
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions assets/src/scripts/_file-elements.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,27 @@ import "highlight.js/styles/github.css";
import { highlightJsName } from "./_utils";

/**
* @param {Node} el
* @param {string} ext
* @param {string} url
* @param {object} outcome
* @param {Object} params
* @param {HTMLElement} params.element
* @param {string} params.fileExtension
* @param {string} params.fileUrl
* @param {object} params.outcome
* @param {string} params.fileIndex
*/
export async function createTableElement(el, ext, url, outcome) {
const data = await fileLoader(ext, url);

el.classList.add("overflow-x-auto");
export async function createTableElement({
element,
fileExtension,
fileUrl,
outcome,
fileIndex,
}) {
const data = await fileLoader(fileExtension, fileUrl);

tableBuilder({
csvString: data,
el,
el: element,
outcome,
fileIndex,
});
}

Expand Down

0 comments on commit e131ba0

Please sign in to comment.