Skip to content
Snippets Groups Projects
Commit bdb15f05 authored by Steinwender, Tamara's avatar Steinwender, Tamara
Browse files

Merge branch 'master' of gitlab.tugraz.at:dbp/web-components/toolkit

parents cf6ff257 5aba377d
No related branches found
No related tags found
No related merge requests found
Pipeline #12281 passed
...@@ -185,8 +185,9 @@ export class DataTableView extends LitElement { ...@@ -185,8 +185,9 @@ export class DataTableView extends LitElement {
this.data = data; this.data = data;
this.table.clear(); this.table.clear();
if (this.data.length) { this.table.rows.add(this.data); } if (this.data.length) {
this.table.order(this.defaultOrder).draw(); this.table.rows.add(this.data);
}
new $.fn.dataTable.Responsive(this.table, { new $.fn.dataTable.Responsive(this.table, {
details: true details: true
...@@ -213,6 +214,10 @@ export class DataTableView extends LitElement { ...@@ -213,6 +214,10 @@ export class DataTableView extends LitElement {
} }
}); });
} }
this.table.order(this.defaultOrder);
this.table.draw();
return this; return this;
} }
......
...@@ -306,6 +306,36 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { ...@@ -306,6 +306,36 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
}); });
} }
uploadFiles(files) {
files.forEach((fileData) => this.uploadFile(fileData));
}
uploadFile(fileData) {
this.statusText = "Uploading " + fileData.filename + "...";
console.log(fileData);
// https://github.com/perry-mitchell/webdav-client#putfilecontents
this.webDavClient
.putFileContents(fileData.filename, f)
.then(contents => {
// create file to send via event
const file = new File([contents], fileData.basename, { type: fileData.mime });
console.log("binaryFile", file);
// send event
const data = {"file": file, "data": fileData};
const event = new CustomEvent("dbp-nextcloud-file-picker-file-uploaded",
{ "detail": data, bubbles: true, composed: true });
this.dispatchEvent(event);
this.statusText = "";
}).catch(error => {
console.error(error.message);
this.statusText = error.message;
});
}
/** /**
* Returns the parent directory path * Returns the parent directory path
* *
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment