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

Fix collapsing columns nextcloud

parent caac2b5e
No related branches found
No related tags found
No related merge requests found
Pipeline #51336 passed
...@@ -239,7 +239,22 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { ...@@ -239,7 +239,22 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) {
if (this._("#select_all_checkmark")) { if (this._("#select_all_checkmark")) {
this._("#select_all_checkmark").title = this.checkAllSelected() ? i18n.t('clipboard.select-nothing') : i18n.t('clipboard.select-all'); this._("#select_all_checkmark").title = this.checkAllSelected() ? i18n.t('clipboard.select-nothing') : i18n.t('clipboard.select-all');
} }
},
renderComplete: () => {
if (this.tabulatorTable !== null) {
const that = this;
setTimeout(function(){
if (that._('.tabulator-responsive-collapse-toggle-open')) {
that._a('.tabulator-responsive-collapse-toggle-open').forEach(element => element.addEventListener("click", that.toggleCollapse.bind(that)));
} }
if (that._('.tabulator-responsive-collapse-toggle-close')) {
that._a('.tabulator-responsive-collapse-toggle-close').forEach(element => element.addEventListener("click", that.toggleCollapse.bind(that)));
}
}, 0);
}
},
}); });
that.generateClipboardTable(); that.generateClipboardTable();
...@@ -337,17 +352,6 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) { ...@@ -337,17 +352,6 @@ export class Clipboard extends ScopedElementsMixin(AdapterLitElement) {
if (this.tabulatorTable !== null) { if (this.tabulatorTable !== null) {
this.tabulatorTable.clearData(); this.tabulatorTable.clearData();
this.tabulatorTable.setData(data); this.tabulatorTable.setData(data);
const that = this;
setTimeout(function(){
if (that._('.tabulator-responsive-collapse-toggle-open')) {
that._a('.tabulator-responsive-collapse-toggle-open').forEach(element => element.addEventListener("click", that.toggleCollapse.bind(that)));
}
if (that._('.tabulator-responsive-collapse-toggle-close')) {
that._a('.tabulator-responsive-collapse-toggle-close').forEach(element => element.addEventListener("click", that.toggleCollapse.bind(that)));
}
}, 0);
} }
} }
if (this._("#select_all")) { if (this._("#select_all")) {
......
...@@ -119,6 +119,11 @@ export class FileSource extends ScopedElementsMixin(DbpFileHandlingLitElement) { ...@@ -119,6 +119,11 @@ export class FileSource extends ScopedElementsMixin(DbpFileHandlingLitElement) {
this.nextcloudPath = this.initialFileHandlingState.path; this.nextcloudPath = this.initialFileHandlingState.path;
} }
break; break;
case "activeTarget":
if (this.activeTarget === "nextcloud") {
this.loadWebdavDirectory();
}
break;
} }
}); });
super.update(changedProperties); super.update(changedProperties);
......
...@@ -306,7 +306,22 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { ...@@ -306,7 +306,22 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
}, },
rowAdded: (row) => { rowAdded: (row) => {
row.getElement().classList.toggle("addRowAnimation"); row.getElement().classList.toggle("addRowAnimation");
},
renderComplete: () => {
if (this.tabulatorTable !== null) {
const that = this;
setTimeout(function(){
if (that._('.tabulator-responsive-collapse-toggle-open')) {
that._a('.tabulator-responsive-collapse-toggle-open').forEach(element => element.addEventListener("click", that.toggleCollapse.bind(that)));
}
if (that._('.tabulator-responsive-collapse-toggle-close')) {
that._a('.tabulator-responsive-collapse-toggle-close').forEach(element => element.addEventListener("click", that.toggleCollapse.bind(that)));
} }
}, 0);
}
},
}); });
...@@ -392,6 +407,10 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { ...@@ -392,6 +407,10 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
} }
} }
_a(selector) {
return this.shadowRoot === null ? this.querySelectorAll(selector) : this.shadowRoot.querySelectorAll(selector);
}
onReceiveWindowMessage(event) { onReceiveWindowMessage(event) {
if (this.webDavClient === null) { if (this.webDavClient === null) {
const data = event.data; const data = event.data;
...@@ -413,14 +432,19 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { ...@@ -413,14 +432,19 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
if (this._("#remember-checkbox") && this._("#remember-checkbox").checked) { if (this._("#remember-checkbox") && this._("#remember-checkbox").checked) {
sessionStorage.setItem('nextcloud-webdav-username', data.loginName); sessionStorage.setItem('nextcloud-webdav-username', data.loginName);
sessionStorage.setItem('nextcloud-webdav-password', data.token); sessionStorage.setItem('nextcloud-webdav-password', data.token);
console.log("saved");
} }
this.loadDirectory(this.directoryPath); this.loadDirectory(this.directoryPath);
} }
} }
} }
toggleCollapse(e) {
const table = this.tabulatorTable;
setTimeout(function() {
table.redraw();
}, 0);
}
/** /**
* Loads the directory from WebDAV * Loads the directory from WebDAV
* *
...@@ -479,7 +503,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { ...@@ -479,7 +503,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
"</d:propfind>" "</d:propfind>"
}) })
.then(contents => { .then(contents => {
//console.log("------", contents);
this.loading = false; this.loading = false;
this.statusText = ""; this.statusText = "";
this.tabulatorTable.setData(contents.data); this.tabulatorTable.setData(contents.data);
...@@ -490,6 +514,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) { ...@@ -490,6 +514,7 @@ export class NextcloudFilePicker extends ScopedElementsMixin(DBPLitElement) {
} else { } else {
this._("#download-button").removeAttribute("disabled"); this._("#download-button").removeAttribute("disabled");
} }
}).catch(error => { }).catch(error => {
console.error(error.message); console.error(error.message);
......
...@@ -230,6 +230,7 @@ export function getFileHandlingCss() { ...@@ -230,6 +230,7 @@ export function getFileHandlingCss() {
.tabulator-responsive-collapse-toggle-open, .tabulator-responsive-collapse-toggle-close{ .tabulator-responsive-collapse-toggle-open, .tabulator-responsive-collapse-toggle-close{
width: 100%; width: 100%;
height: 100%; height: 100%;
line-height: 37px;
} }
.tabulator-row-handle{ .tabulator-row-handle{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment