mirror of
https://github.com/nextcloud/server.git
synced 2026-04-26 00:27:49 -04:00
Merge pull request #49568 from nextcloud/template-picker-ux-improvement
feat(templates): make second click as confirmation on templates picker
This commit is contained in:
commit
aba4d94c10
11 changed files with 21 additions and 8 deletions
|
|
@ -13,7 +13,7 @@
|
|||
name="template-picker"
|
||||
@change="onCheck">
|
||||
|
||||
<label :for="id" class="template-picker__label">
|
||||
<label :for="id" class="template-picker__label" @click="onClick">
|
||||
<div class="template-picker__preview"
|
||||
:class="failedPreview ? 'template-picker__preview--failed' : ''">
|
||||
<img class="template-picker__image"
|
||||
|
|
@ -128,6 +128,11 @@ export default {
|
|||
focus() {
|
||||
this.$refs.input?.focus()
|
||||
},
|
||||
onClick() {
|
||||
if (this.checked) {
|
||||
this.$emit('confirm-click', this.fileid)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@
|
|||
<TemplatePreview v-bind="emptyTemplate"
|
||||
ref="emptyTemplatePreview"
|
||||
:checked="checked === emptyTemplate.fileid"
|
||||
@confirm-click="onConfirmClick"
|
||||
@check="onCheck" />
|
||||
|
||||
<TemplatePreview v-for="template in provider.templates"
|
||||
|
|
@ -26,6 +27,7 @@
|
|||
v-bind="template"
|
||||
:checked="checked === template.fileid"
|
||||
:ratio="provider.ratio"
|
||||
@confirm-click="onConfirmClick"
|
||||
@check="onCheck" />
|
||||
</ul>
|
||||
|
||||
|
|
@ -207,6 +209,12 @@ export default defineComponent({
|
|||
this.checked = fileid
|
||||
},
|
||||
|
||||
onConfirmClick(fileid: number) {
|
||||
if (fileid === this.checked) {
|
||||
this.onSubmit()
|
||||
}
|
||||
},
|
||||
|
||||
async createFile(templateFields) {
|
||||
const currentDirectory = new URL(window.location.href).searchParams.get('dir') || '/'
|
||||
|
||||
|
|
|
|||
2
dist/5421-5421.js
vendored
Normal file
2
dist/5421-5421.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/5421-5421.js.map
vendored
Normal file
1
dist/5421-5421.js.map
vendored
Normal file
File diff suppressed because one or more lines are too long
1
dist/5421-5421.js.map.license
vendored
Symbolic link
1
dist/5421-5421.js.map.license
vendored
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
5421-5421.js.license
|
||||
2
dist/694-694.js
vendored
2
dist/694-694.js
vendored
File diff suppressed because one or more lines are too long
1
dist/694-694.js.map
vendored
1
dist/694-694.js.map
vendored
File diff suppressed because one or more lines are too long
1
dist/694-694.js.map.license
vendored
1
dist/694-694.js.map.license
vendored
|
|
@ -1 +0,0 @@
|
|||
694-694.js.license
|
||||
4
dist/files-init.js
vendored
4
dist/files-init.js
vendored
File diff suppressed because one or more lines are too long
2
dist/files-init.js.map
vendored
2
dist/files-init.js.map
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue