DEV: Move jsuites library to separate file
This commit is contained in:
parent
67a27f0ece
commit
40f42a92d2
|
@ -9,6 +9,7 @@
|
|||
"minimum_discourse_version": null,
|
||||
"maximum_discourse_version": null,
|
||||
"assets": {
|
||||
"jsuites": "assets/jsuites.js",
|
||||
"jspreadsheet": "assets/jspreadsheet.js"
|
||||
},
|
||||
"modifiers": {
|
||||
|
|
13311
assets/jspreadsheet.js
13311
assets/jspreadsheet.js
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue