Skip to content
This repository was archived by the owner on Oct 29, 2020. It is now read-only.

waiting for image to load for mobile. fixes #3803#3807

Merged
sbsmith86 merged 1 commit intoDoSomethingArchive:devfrom
sbsmith86:reportback-crop-limit-bug
Jan 27, 2015
Merged

waiting for image to load for mobile. fixes #3803#3807
sbsmith86 merged 1 commit intoDoSomethingArchive:devfrom
sbsmith86:reportback-crop-limit-bug

Conversation

@sbsmith86
Copy link
Contributor

The problem

On mobile, when the validation ran the image had not yet been loaded and so the function thought that the dimension of the image was 0x0, causing an error to be thrown that the image was not large enough.

Changes

This PR creates an image object from the file reader result and then waits for it to load using image.onload = function() {} . It then refactors the code a bit so that we pass the image created to various functions instead of the file reader result object.

@DoSomething/front-end

@DFurnes
Copy link
Contributor

DFurnes commented Jan 27, 2015

👍 :shipit:

sbsmith86 added a commit that referenced this pull request Jan 27, 2015
waiting for image to load for mobile. fixes #3803
@sbsmith86 sbsmith86 merged commit 3021a0a into DoSomethingArchive:dev Jan 27, 2015
@barryclark
Copy link
Contributor

🚀

@sbsmith86 sbsmith86 deleted the reportback-crop-limit-bug branch February 13, 2015 19:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants