Skip to content
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

remove image from sidebar if deleted from image popup toolbar #146

Closed
cspencer905 opened this issue Mar 23, 2015 · 7 comments
Closed

remove image from sidebar if deleted from image popup toolbar #146

cspencer905 opened this issue Mar 23, 2015 · 7 comments
Labels
Milestone

Comments

@cspencer905
Copy link

on right side panel when trying to delete an image i was redirected to a new page that doesn't exist
when i delete it from the floating editing panel when the image is selected it no longer appears on the map but it is still there

@jywarren jywarren added the bug label Mar 23, 2015
@jywarren
Copy link
Member

I noticed this; I think it wouldn't be a tough fix but we have a bit of a long list at the moment :-(

I'm hoping we can recruit more contributors soon; please pass on the word if you know any developers looking to help out on an open source project!

@jywarren jywarren added the ready label Mar 27, 2015
@mathewlippincott
Copy link

Another case of this is I delete it from the map but it stays in the "images" menu but without the ability to re-place it on the map.
screen shot 2015-03-27 at 4 28 13 pm

@mathewlippincott
Copy link

images no longer appear on the map but all reappear when the map is reloaded
screen shot 2015-03-27 at 5 22 59 pm

@jywarren
Copy link
Member

2 issues; we should show an error when you're not logged in (covered in #118) and want to delete, and should remove image from sidebar if deleted from image popup toolbar.

@jywarren jywarren changed the title deleted images won't be deleted remove image from sidebar if deleted from image popup toolbar Apr 1, 2015
@jywarren jywarren modified the milestone: 2.1 release Apr 1, 2015
@jywarren
Copy link
Member

This is actually a bit more complex; the 'delete' listener we're using is fired after the image is deleted from the client-side Leaflet environment. I just wrote code that "confirms" with a popup, sends a "delete" command to the server, and then removes the image from the sidebar, but by the time that fires, it's already been removed from the local instance -- though it'll show up again if the page is reloaded. We have to override the native "delete" behavior of Leaflet.DistortableImage to not actually delete, but to defer to the handler we've provided for the "delete" event.

@jywarren
Copy link
Member

OK, this is partially complete in my local branch; now we need to ensure that the uploader adds a "warpable-#" id to newly uploaded images' sidebar elements, so this works for newly uploaded images too.

@numeroteca
Copy link

More on this behaviour:
When an image is deleted it disappears from the sidebar. The top status check mark changes to red.
When the page is reloaded the image re-appears placed in the map. The top status check mark changes to green.
Map: http://mapknitter.org/maps/placa-salvador-segui-barcelona#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants