viewer: delete with Del key (fix #313)
parent
b9e65aa2e3
commit
6b9f50ab31
|
@ -5,6 +5,7 @@
|
|||
:class="{ fullyOpened, slideshowTimer }"
|
||||
:style="{ width: outerWidth }"
|
||||
@fullscreenchange="fullscreenChange"
|
||||
@keydown="keydown"
|
||||
>
|
||||
<ImageEditor
|
||||
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 */
|
||||
async deleteCurrent() {
|
||||
let idx = this.photoswipe.currIndex - this.globalAnchor;
|
||||
|
|
Loading…
Reference in New Issue