Skip to content
Snippets Groups Projects
Unverified Commit c5ba23f5 authored by Bekerle, Patrizio's avatar Bekerle, Patrizio :fire:
Browse files

Check if elements are already in the dom

parent 488da7b6
No related branches found
No related tags found
No related merge requests found
......@@ -310,8 +310,11 @@ export class FileSource extends ScopedElementsMixin(DBPLitElement) {
}
loadWebdavDirectory() {
if (this._('#nextcloud-file-picker').webDavClient !== null) {
this._('#nextcloud-file-picker').loadDirectory(this._('#nextcloud-file-picker').directoryPath);
const filePicker = this._('#nextcloud-file-picker');
// check if element is already in the dom (for example if "dialog-open" attribute is set)
if (filePicker && filePicker.webDavClient !== null) {
filePicker.loadDirectory(filePicker.directoryPath);
}
}
......@@ -320,11 +323,16 @@ export class FileSource extends ScopedElementsMixin(DBPLitElement) {
this.loadWebdavDirectory();
}
MicroModal.show(this._('#modal-picker'), {
disableScroll: true,
onClose: modal => { this.isDialogOpen = false;
this._('#nextcloud-file-picker').selectAllButton = true;}
});
const filePicker = this._('#modal-picker');
// check if element is already in the dom (for example if "dialog-open" attribute is set)
if (filePicker) {
MicroModal.show(filePicker, {
disableScroll: true,
onClose: modal => { this.isDialogOpen = false;
this._('#nextcloud-file-picker').selectAllButton = true;}
});
}
}
closeDialog() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment