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

Move the sidebar related code from viewer.js into PDFSidebar #7038

Merged
merged 2 commits into from
Feb 28, 2016
Merged

Move the sidebar related code from viewer.js into PDFSidebar #7038

merged 2 commits into from
Feb 28, 2016

Commits on Feb 27, 2016

  1. Refactor how PDFOutlineView/PDFAttachmentView is initialized in v…

    …iewer.js, rename the classes, and refactor their `render` methods
    
    Changes `PDFOutlineView`/`PDFAttachmentView` to be initialized once, since we're always creating them, and refactor their `render` methods to instead pass in the `outline`/`attachments`.
    
    For consistency with other "classes", the `PDFOutlineView`/`PDFAttachmentView` are renamed to `PDFOutlineViewer`/`PDFAttachmentViewer`.
    
    Also, make sure that the outline/attachments are reset when the document is closed. Currently we keep the old ones around until the `getOutline`/`getAttachments` API calls are resolved for a new document.
    Snuffleupagus committed Feb 27, 2016
    Configuration menu
    Copy the full SHA
    21f0482 View commit details
    Browse the repository at this point in the history
  2. Move the sidebar related code from viewer.js into PDFSidebar

    The sidebar code has, except for minor fixes/additions (such as attachments), been largely untouch for years.
    To avoid having a bunch of sidebar code sprinkled throughout viewer.js, this patch moves the sidebar code into a separate file (pdf_sidebar.js), similar to how most other functionality has been moved in the last few years.
    
    Besides simply moving code around, this patch also has the added benefit that we now keep track of the sidebar state (not just opened/closed).
    This now makes it possible to handle both `Preferences` *and* `ViewHistory` settings for the sidebar state in a cleaner way, preventing strange and confusing interactions between the two.
    Snuffleupagus committed Feb 27, 2016
    Configuration menu
    Copy the full SHA
    67a1dfc View commit details
    Browse the repository at this point in the history