DEV: Move jsuites library to separate file

This commit is contained in:
Keegan George 2022-07-14 09:21:22 -07:00
parent 67a27f0ece
commit 40f42a92d2
4 changed files with 13319 additions and 13312 deletions

View File

@ -9,6 +9,7 @@
"minimum_discourse_version": null,
"maximum_discourse_version": null,
"assets": {
"jsuites": "assets/jsuites.js",
"jspreadsheet": "assets/jspreadsheet.js"
},
"modifiers": {

File diff suppressed because it is too large Load Diff

13310
assets/jsuites.js Normal file

File diff suppressed because it is too large Load Diff

View File

@ -13,11 +13,17 @@ export default Component.extend({
// ? TODO move to component (read about not allowing Controllers to do DOM manipulation)
this._super(...arguments);
loadScript(settings.theme_uploads.jspreadsheet).then(() => {
this.loadLibraries().then(() => {
this.buildTable(this.tableHtml);
});
},
loadLibraries() {
return loadScript(settings.theme_uploads.jsuites).then(() => {
return loadScript(settings.theme_uploads.jspreadsheet);
});
},
buildTable(table) {
const tableObject = tableToObj(table);
const headings = [];
@ -41,6 +47,7 @@ export default Component.extend({
const spreadsheetContainer = document.querySelector("#spreadsheet");
// eslint-disable-next-line no-undef
this.spreadsheet = jspreadsheet(spreadsheetContainer, {
data: tableData,
columns,