-
Notifications
You must be signed in to change notification settings - Fork 283
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 spinner after an export is complete #470
Labels
Comments
Uploaded to GCI Dashboard |
63 tasks
5 tasks
Published |
jywarren
pushed a commit
that referenced
this issue
Dec 14, 2019
* FIX: Remove loading spinner after image export In the old UI, the spinner would continue spinning after the images have been exported. Resolves #470 * FIX: Wrap startExport function inside of a promise * FIX: Add polyfill for ES6 promises * FIX: Replace arrow function with normal function Change was necessary because arrow functions are not supported in ES5. * FIX: Bind this startExport function The change was necessary because in the Promise the value of keyword this gets lost
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Please note we are preparing to participate in Google Code-in, and have reserved this issue for GCI participants - but we'd love to have your help with another one! Please check out https://code.publiclab.org to see more.
Problem
LDI provides the ability to export multiple images.
Demo it here: https://publiclab.github.io/Leaflet.DistortableImage/examples/select.html
by
ctrl + click
ing on one or more images.While the export is in progress a spinner icon appears, but it does not yield back to the original export icon after completion.
We would like it to do so.
Solution:
Relevant information:
addHooks
weif (edit instanceof L.DistortableImage.Edit) { edit._getExport(); }
Single image instances have a handler classL.DistortableImage.Edit
that triggers a single image exportedit._getExport();
(you can test this one by clicking on any image and hitting the export icon on its attached toolbar). Multiple images have a separate handlerL.DistortableCollection.Edit
that calls the multiple export function,edit.startExport()
, which you demo'd earlier. We check which one to call.loader
class to it to animate it's spin via css.edit.startExport()
Leaflet.DistortableImage/src/edit/actions/ExportAction.js
Lines 24 to 35 in f537898
startExport
, follow the logic to find the relevant lines where the export completes, and use this knowledge to remove the loader icon and render the original export icon again.Leaflet.DistortableImage/src/edit/DistortableCollection.Edit.js
Lines 194 to 257 in f537898
to reverse it.
💬 Get help
If you need any help - here are some options:
Labeled
hard
because requires a deeper understanding of LDI's moving parts.The text was updated successfully, but these errors were encountered: