viewer: move to custom dialog
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/783/head
parent
ba19a3b45f
commit
60281c1f7f
|
@ -496,7 +496,10 @@ export default defineComponent({
|
||||||
// Monkey patch for focus trapping in sidebar
|
// Monkey patch for focus trapping in sidebar
|
||||||
const _onFocusIn = this.photoswipe.keyboard['_onFocusIn'];
|
const _onFocusIn = this.photoswipe.keyboard['_onFocusIn'];
|
||||||
this.photoswipe.keyboard['_onFocusIn'] = (e: FocusEvent) => {
|
this.photoswipe.keyboard['_onFocusIn'] = (e: FocusEvent) => {
|
||||||
if (e.target instanceof HTMLElement && e.target.closest('#app-sidebar-vue, .v-popper__popper, .modal-mask')) {
|
if (
|
||||||
|
e.target instanceof HTMLElement &&
|
||||||
|
e.target.closest(['#app-sidebar-vue', '.v-popper__popper', '.modal-mask', '.oc-dialog'].join(','))
|
||||||
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
_onFocusIn.call(this.photoswipe!.keyboard, e);
|
_onFocusIn.call(this.photoswipe!.keyboard, e);
|
||||||
|
@ -930,11 +933,13 @@ export default defineComponent({
|
||||||
},
|
},
|
||||||
|
|
||||||
/** Key press events */
|
/** Key press events */
|
||||||
keydown(e: KeyboardEvent) {
|
async keydown(e: KeyboardEvent) {
|
||||||
if (
|
if (
|
||||||
e.key === 'Delete' &&
|
e.key === 'Delete' &&
|
||||||
!this.routeIsPublic &&
|
!this.routeIsPublic &&
|
||||||
confirm(this.t('memories', 'Are you sure you want to delete?'))
|
(await utils.confirmDestructive({
|
||||||
|
title: this.t('memories', 'Are you sure you want to delete?'),
|
||||||
|
}))
|
||||||
) {
|
) {
|
||||||
this.deleteCurrent();
|
this.deleteCurrent();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue