pdf.js/web
Jonas Jenwald 085e7a7a74 Implement sidebar resizing for modern browsers, by utilizing CSS variables (issue 2072)
By making use of modern CSS features, in this case [CSS variables](https://developer.mozilla.org/en-US/docs/Web/CSS/Using_CSS_variables), implementing sidebar resizing is actually quite simple. Not only will the amount of added code be fairly small, but it should also be easy to maintain since there's no need for complicated JavaScript hacks in order to update the CSS. Another benefit is that the JavaScript code doesn't need to make detailed assumptions about the exact structure of the HTML/CSS code.

Obviously this will not work in older browsers, such as IE, that lack support for CSS variables. In those cases sidebar resizing is simply disabled (via feature detection), and the resizing DOM element hidden, and the behaviour is thus *identical* to the current (fixed-width) sidebar.
However, considering the simplicity of the implementation, I really don't see why limiting this feature to "modern" browsers is a problem.

Finally, note that a few edge-cases meant that the patch is a bit larger than what the basic functionality would dictate. Among those is first of all proper RTL support, and secondly (automatic) resizing of the sidebar when the width of the *entire* viewer changes. Another, pre-existing, issue fixed here is the incomplete interface of `NullL10n`.

*Please note:* This patch has been successfully tested in both LTR and RTL viewer locales, in recent versions of Firefox and Chrome.

Fixes 2072.
2017-11-06 15:58:24 +01:00
..
images Add icons for the new "Select tool" button 2017-05-22 00:51:03 +02:00
.gitignore Remove obselete file from .gitignore 2015-01-26 16:44:45 +01:00
annotation_layer_builder.css Implement support for polygon annotations 2017-09-23 16:52:47 +02:00
annotation_layer_builder.js Prevent the annotationLayer from, in some cases, becoming duplicated on the first page when the document loads 2017-10-07 11:34:53 +02:00
app.js Implement sidebar resizing for modern browsers, by utilizing CSS variables (issue 2072) 2017-11-06 15:58:24 +01:00
base_viewer.js Remove all warning/fallback code for obsolete method signatures in web/ files 2017-10-15 16:57:30 +02:00
chrome-i18n-allow-access-to-file-urls.json Add translations of "Allow access to file URLs" 2015-08-14 18:59:55 +02:00
chromecom.js ES6-ify the code in web/chromecom.js 2017-11-05 13:26:06 +01:00
compressed.tracemonkey-pldi-09.pdf Add Makefile. Move some files around to make building the website easier. 2011-07-05 10:53:57 -07:00
debugger.js Fix inconsistent spacing and trailing commas in objects in web/ files, so we can enable the comma-dangle and object-curly-spacing ESLint rules later on 2017-06-01 12:47:47 +02:00
default_preferences.json Add support for, the API property, PageMode in the viewer (issue 8657) 2017-07-19 16:58:25 +02:00
dom_events.js ES6-ify the code in web/dom_events.js 2017-07-29 13:17:22 +02:00
download_manager.js Convert DownloadManager to an ES6 class 2017-08-06 14:15:18 +02:00
firefox_print_service.js Use let/const instead of var in the printing code 2017-10-22 16:13:14 +02:00
firefoxcom.js ES6-ify the code in web/firefoxcom.js 2017-09-10 12:51:33 +02:00
genericcom.js Replace var with let in web/genericcom and web/genericl10n 2017-09-10 13:09:26 +02:00
genericl10n.js Replace var with let in web/genericcom and web/genericl10n 2017-09-10 13:09:26 +02:00
grab_to_pan.js Fix inconsistent spacing and trailing commas in objects in web/ files, so we can enable the comma-dangle and object-curly-spacing ESLint rules later on 2017-06-01 12:47:47 +02:00
interfaces.js Store the rotation in the PDFHistory 2017-09-09 11:27:05 +02:00
overlay_manager.js Convert the overlay manager to ES6 syntax 2017-05-28 21:18:18 +02:00
password_prompt.js Change var to let, and use object destructuring, in a couple of previously class converted web/*.js files 2017-07-03 11:22:49 +02:00
pdf_attachment_viewer.js Attempt to delay disabling of the attachment view until FileAttachment annotations of the *initial* page has been parsed 2017-08-17 14:30:03 +02:00
pdf_cursor_tools.js Remove the enableHandToolOnLoad preference migration code in web/pdf_cursor_tools.js 2017-10-17 18:34:33 +02:00
pdf_document_properties.js Change var to let, and use object destructuring, in a couple of previously class converted web/*.js files 2017-07-03 11:22:49 +02:00
pdf_find_bar.js Ensure that PDFFindBar._adjustWidth is called in all situations where the width of the findbar might have changed 2017-07-05 11:34:14 +02:00
pdf_find_controller.js More robust getPage() error handling. 2017-08-04 17:03:33 -05:00
pdf_history.js Replace a few occurences of var with let in already ES6 converted web/ files 2017-10-22 16:23:38 +02:00
pdf_link_service.js Merge pull request #9077 from yurydelendik/v2 2017-10-31 14:24:20 -07:00
pdf_outline_viewer.js Call the reset() methods in the PDFAttachmentViewer and PDFOutlineViewer constructors 2017-08-17 13:04:24 +02:00
pdf_page_view.js Merge remote-tracking branch 'mozilla/version-2.0' into v2 2017-10-27 14:01:45 -05:00
pdf_presentation_mode.js Change var to let, and use object destructuring, in a couple of previously class converted web/*.js files 2017-07-03 11:22:49 +02:00
pdf_print_service.js Use let/const instead of var in the printing code 2017-10-22 16:13:14 +02:00
pdf_rendering_queue.js Replace a few occurences of var with let in already ES6 converted web/ files 2017-10-22 16:23:38 +02:00
pdf_sidebar_resizer.js Implement sidebar resizing for modern browsers, by utilizing CSS variables (issue 2072) 2017-11-06 15:58:24 +01:00
pdf_sidebar.js Layout the sidebar in the same vertical position regardless of the viewer width (issue 4052, bug 850591) 2017-10-11 18:17:28 +02:00
pdf_single_page_viewer.js Implement a PDFSinglePageViewer class (issue 8188) 2017-09-23 16:28:04 +02:00
pdf_thumbnail_view.js Only handle RenderingCancelledException in the viewer code, when rendering is cancelled 2017-10-04 18:13:46 +02:00
pdf_thumbnail_viewer.js Slightly refactor the pages rotation handling code in the viewer 2017-09-09 11:27:05 +02:00
pdf_viewer.component.js Implement a PDFSinglePageViewer class (issue 8188) 2017-09-23 16:28:04 +02:00
pdf_viewer.css Ensure canvas is really hidden when used with pdfjs-dist. 2017-06-20 14:45:07 -05:00
pdf_viewer.js Refactor PDFViewer to extend an abstract BaseViewer class 2017-09-23 16:28:04 +02:00
pdfjs.js Fixes pdf.js library source detection. 2017-07-13 14:57:39 -05:00
preferences.js Replace a few occurences of var with let in already ES6 converted web/ files 2017-10-22 16:23:38 +02:00
secondary_toolbar.js Fix inconsistent spacing and trailing commas in objects in web/ files, so we can enable the comma-dangle and object-curly-spacing ESLint rules later on 2017-06-01 12:47:47 +02:00
text_layer_builder.css Use default line height for the text layer 2015-12-02 23:00:12 +01:00
text_layer_builder.js Convert the text layer builder to ES6 syntax 2017-06-29 23:41:25 +02:00
toolbar.js Remove the selectScaleOption helper function, in Toolbar._updateUIState, and simply inline its code instead 2017-06-26 13:06:24 +02:00
ui_utils.js Implement sidebar resizing for modern browsers, by utilizing CSS variables (issue 2072) 2017-11-06 15:58:24 +01:00
view_history.js Remove the migration code for old localStorage data in ViewHistory 2017-08-19 11:41:04 +02:00
viewer-snippet-chrome-extension.html Wraps mozL10n to async calls; splits firefox and generic l10n libs. 2017-05-31 09:22:25 -05:00
viewer-snippet-chrome-overlays.html Add translations of "Allow access to file URLs" 2015-08-14 18:59:55 +02:00
viewer-snippet-firefox-extension.html Wraps mozL10n to async calls; splits firefox and generic l10n libs. 2017-05-31 09:22:25 -05:00
viewer-snippet-minified.html Remove XHTML leftovers from the viewer HTML files 2016-02-14 13:23:34 +01:00
viewer-snippet.html Wraps mozL10n to async calls; splits firefox and generic l10n libs. 2017-05-31 09:22:25 -05:00
viewer.css Implement sidebar resizing for modern browsers, by utilizing CSS variables (issue 2072) 2017-11-06 15:58:24 +01:00
viewer.html Implement sidebar resizing for modern browsers, by utilizing CSS variables (issue 2072) 2017-11-06 15:58:24 +01:00
viewer.js Implement sidebar resizing for modern browsers, by utilizing CSS variables (issue 2072) 2017-11-06 15:58:24 +01:00