viewer: delete with Del key (fix #313)
parent
b9e65aa2e3
commit
6b9f50ab31
|
@ -5,6 +5,7 @@
|
||||||
:class="{ fullyOpened, slideshowTimer }"
|
:class="{ fullyOpened, slideshowTimer }"
|
||||||
:style="{ width: outerWidth }"
|
:style="{ width: outerWidth }"
|
||||||
@fullscreenchange="fullscreenChange"
|
@fullscreenchange="fullscreenChange"
|
||||||
|
@keydown="keydown"
|
||||||
>
|
>
|
||||||
<ImageEditor
|
<ImageEditor
|
||||||
v-if="editorOpen"
|
v-if="editorOpen"
|
||||||
|
@ -905,6 +906,17 @@ export default defineComponent({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/** Key press events */
|
||||||
|
keydown(e: KeyboardEvent) {
|
||||||
|
if (
|
||||||
|
e.key === "Delete" &&
|
||||||
|
!this.routeIsPublic &&
|
||||||
|
confirm(this.t("memories", "Are you sure you want to delete?"))
|
||||||
|
) {
|
||||||
|
this.deleteCurrent();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/** Delete this photo and refresh */
|
/** Delete this photo and refresh */
|
||||||
async deleteCurrent() {
|
async deleteCurrent() {
|
||||||
let idx = this.photoswipe.currIndex - this.globalAnchor;
|
let idx = this.photoswipe.currIndex - this.globalAnchor;
|
||||||
|
|
Loading…
Reference in New Issue