Skip to content

Refactor document properties overlay #5959

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

Merged
merged 4 commits into from
Apr 27, 2015

Conversation

timvandermeij
Copy link
Contributor

This PR follows a similar pattern as other refactoring patches. The aim here is to make the document properties code more class-like, simplifying field passing/handling and avoiding passing a reference to the secondary toolbar.

Using the ?w=1 URL parameter makes review easier.

@timvandermeij
Copy link
Contributor Author

@Snuffleupagus Thank you for the thorough review! I will make the changes in a new set of commits.

@timvandermeij timvandermeij force-pushed the document-properties-class branch 3 times, most recently from a5fee36 to c02c33d Compare April 24, 2015 19:49
This patch:
- Puts public methods at the top of the file
- Puts private methods below the public methods and marks them with an underscore
- Adds JSDoc comments to the class
- Adds setDocumentAndUrl to avoid having to handle that in `viewer.js`
@timvandermeij timvandermeij force-pushed the document-properties-class branch from c02c33d to 7c04ee2 Compare April 26, 2015 13:54
this.pdfDocument = null;

// Bind the event listener for the Close button.
if (options.closeButton) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about not catching this earlier, but the button is missing from the JSDoc comment above. {HTMLButtonElement} would probably be an OK type to use.

The PR is good to go once this is addressed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in the most recent commit.

This patch:
- Simplifies the way fields are passed to the document properties overlay
- Simplifies the way fields are filled internally in the document properties overlay
- Avoids passing a document properties reference to the secondary toolbar
@timvandermeij timvandermeij force-pushed the document-properties-class branch from 7c04ee2 to 6abf3d6 Compare April 27, 2015 13:26
@timvandermeij
Copy link
Contributor Author

/botio-linux preview

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/70271673518e5ff/output.txt

@Snuffleupagus
Copy link
Collaborator

Looks great, thank you!

Snuffleupagus added a commit that referenced this pull request Apr 27, 2015
@Snuffleupagus Snuffleupagus merged commit 5c47a7f into mozilla:master Apr 27, 2015
@timvandermeij timvandermeij deleted the document-properties-class branch April 27, 2015 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants