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

Prevent the Document Properties from being empty when the dialog is opened before the file has started loading #4546

Merged
merged 3 commits into from
Apr 2, 2014
Merged

Prevent the Document Properties from being empty when the dialog is opened before the file has started loading #4546

merged 3 commits into from
Apr 2, 2014

Conversation

Snuffleupagus
Copy link
Collaborator

Currently when opening the Document Properties during file load, all fields will remain blank, with the following message printed in the console: TypeError: PDFView.pdfDocument is null.

This PR adds a promise that is resolved when the data is available, and also re-factors the code slightly to add a updateUI function so that the file size is updated once it's available.

/cc @timvandermeij

@Snuffleupagus
Copy link
Collaborator Author

/botio-windows preview

@pdfjsbot
Copy link

pdfjsbot commented Apr 1, 2014

From: Bot.io (Windows)


Received

Command cmd_preview from @Snuffleupagus received. Current queue size: 0

Live output at: http://107.22.172.223:8877/662ae9e033480cb/output.txt

@timvandermeij
Copy link
Contributor

I cannot replicate the TypeError, but I do notice that the dialog stays blank until you open it again. With your version, the dialog is indeed updated once the file has been loaded, so I think that's better behaviour for the dialog.

@Snuffleupagus
Copy link
Collaborator Author

I cannot replicate the TypeError

It can be tricky to reproduce, since it requires that you manage to open the Document Properties after the viewer itself is loaded, but before the PDF file has begun loading.

With your version, the dialog is indeed updated once the file has been loaded, so I think that's better behaviour for the dialog.

So, is this PR good to go then? :-)

@yurydelendik
Copy link
Contributor

/botio-linux preview

@pdfjsbot
Copy link

pdfjsbot commented Apr 2, 2014

From: Bot.io (Linux)


Received

Command cmd_preview from @yurydelendik received. Current queue size: 0

Live output at: http://107.21.233.14:8877/8be769121390b00/output.txt

yurydelendik added a commit that referenced this pull request Apr 2, 2014
…for-data

Prevent the Document Properties from being empty when the dialog is opened before the file has started loading
@yurydelendik yurydelendik merged commit 9b0038f into mozilla:master Apr 2, 2014
@yurydelendik
Copy link
Contributor

Thanks

@Snuffleupagus Snuffleupagus deleted the document-properties-wait-for-data branch April 2, 2014 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants