-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Automatically jumps to the next photo when deleting while previewing. #1143
Conversation
@ramiresviana could you please review it? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an issue when pressing enter on delete dialog, the next()
is being triggered. This should be solved by:
- Moving
this.closeHovers()
to afterthis.$emit
onthis.closeHovers() - Changing the
keyup
tokeydown
onfilebrowser/frontend/src/components/files/Preview.vue
Lines 136 to 142 in dcbc328
window.addEventListener('keyup', this.key) this.$store.commit('setPreviewMode', true) this.listing = this.oldReq.items this.updatePreview() }, beforeDestroy () { window.removeEventListener('keyup', this.key) - Removing
event.preventDefault()
onevent.preventDefault()
The problem I'm running into is that after omitting |
Just omitting |
Yeah, so I've tried using The problem seems to be that |
Every element that is on template body of the component is considered a child, so |
I agree, what you're saying is true. The difference here is that while the Delete button is a child of the Preview component, the Delete prompt is not. And it's the Delete prompt which is ultimately responsible for making the API call to delete the file, and then calling So given the limitation here that an event emitted by a child component has to be handled by the parent component (either via |
I see now, since VueJS does not provide an proper solution for that case, i think we can use the |
Ok, committed a new round of changes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Navigation stops working when renaming file on preview, can you take a look on that? Similarly to the prompts/Delete
you will need to create an event for prompts/Rename
.
I did a clean build from master, and the rename issue is present there as well, so it looks to be an unrelated issue out of scope for this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, thank you for contributing to this project.
Cheers, happy to help! |
Description
Deletions made while previewing now immediately load the preview of the next file in the list. When the last file is deleted, previewing ends and returns to the file list, as before.
Closes #1091