DEV: Move jsuites library to separate file
This commit is contained in:
parent
67a27f0ece
commit
40f42a92d2
|
@ -9,6 +9,7 @@
|
||||||
"minimum_discourse_version": null,
|
"minimum_discourse_version": null,
|
||||||
"maximum_discourse_version": null,
|
"maximum_discourse_version": null,
|
||||||
"assets": {
|
"assets": {
|
||||||
|
"jsuites": "assets/jsuites.js",
|
||||||
"jspreadsheet": "assets/jspreadsheet.js"
|
"jspreadsheet": "assets/jspreadsheet.js"
|
||||||
},
|
},
|
||||||
"modifiers": {
|
"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)
|
// ? TODO move to component (read about not allowing Controllers to do DOM manipulation)
|
||||||
this._super(...arguments);
|
this._super(...arguments);
|
||||||
|
|
||||||
loadScript(settings.theme_uploads.jspreadsheet).then(() => {
|
this.loadLibraries().then(() => {
|
||||||
this.buildTable(this.tableHtml);
|
this.buildTable(this.tableHtml);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
loadLibraries() {
|
||||||
|
return loadScript(settings.theme_uploads.jsuites).then(() => {
|
||||||
|
return loadScript(settings.theme_uploads.jspreadsheet);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
buildTable(table) {
|
buildTable(table) {
|
||||||
const tableObject = tableToObj(table);
|
const tableObject = tableToObj(table);
|
||||||
const headings = [];
|
const headings = [];
|
||||||
|
@ -41,6 +47,7 @@ export default Component.extend({
|
||||||
|
|
||||||
const spreadsheetContainer = document.querySelector("#spreadsheet");
|
const spreadsheetContainer = document.querySelector("#spreadsheet");
|
||||||
|
|
||||||
|
// eslint-disable-next-line no-undef
|
||||||
this.spreadsheet = jspreadsheet(spreadsheetContainer, {
|
this.spreadsheet = jspreadsheet(spreadsheetContainer, {
|
||||||
data: tableData,
|
data: tableData,
|
||||||
columns,
|
columns,
|
||||||
|
|
Loading…
Reference in New Issue