mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
Et2VfsSelectDialog: In Save As mode, selecting a file changes filename to the selected name
Plus some vertical spacing fixes
This commit is contained in:
parent
b429434010
commit
1bfd3ac6fe
@ -8,6 +8,7 @@ export default css`
|
|||||||
et2-dialog::part(body) {
|
et2-dialog::part(body) {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
gap: var(--sl-spacing-small);
|
||||||
}
|
}
|
||||||
|
|
||||||
.et2_toolbar {
|
.et2_toolbar {
|
||||||
|
@ -33,7 +33,7 @@ When the user closes the dialog, getComplete() will return the selected files.
|
|||||||
|
|
||||||
```js
|
```js
|
||||||
const dialog = this.et2.getWidgetById("files");
|
const dialog = this.et2.getWidgetById("files");
|
||||||
let files = await dialog.getComplete();
|
let [button, files] = await dialog.getComplete();
|
||||||
```
|
```
|
||||||
|
|
||||||
This is probably the best way to get files (or directories) that you then want to do something with on the client. See
|
This is probably the best way to get files (or directories) that you then want to do something with on the client. See
|
||||||
|
@ -583,13 +583,22 @@ export class Et2VfsSelectDialog
|
|||||||
|
|
||||||
if(file && !file.disabled)
|
if(file && !file.disabled)
|
||||||
{
|
{
|
||||||
// Can't select a directory normally, can't select anything in "saveas"
|
// Can't select a directory normally
|
||||||
if(file.value.isDir && this.mode != "select-dir" || this.mode == "saveas")
|
if(file.value.isDir && this.mode != "select-dir")
|
||||||
{
|
{
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// can't select anything in "saveas", but set the file name
|
||||||
|
else if(this.mode == "saveas")
|
||||||
|
{
|
||||||
|
this._filenameNode.value = file.value.name;
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
this.updateComplete.then(() => this._filenameNode.focus());
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Set focus after updating so the value is announced by screen readers
|
// Set focus after updating so the value is announced by screen readers
|
||||||
//this.updateComplete.then(() => this.displayInput.focus({ preventScroll: true }));
|
//this.updateComplete.then(() => this.displayInput.focus({ preventScroll: true }));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user