mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Document properties
This commit is contained in:
parent
c6d201b13b
commit
5f7ded4ff6
10 changed files with 385 additions and 18 deletions
|
@ -26,6 +26,7 @@ var SecondaryToolbar = {
|
|||
initialize: function secondaryToolbarInitialize(options) {
|
||||
this.toolbar = options.toolbar;
|
||||
this.presentationMode = options.presentationMode;
|
||||
this.documentProperties = options.documentProperties;
|
||||
this.buttonContainer = this.toolbar.firstElementChild;
|
||||
|
||||
// Define the toolbar buttons.
|
||||
|
@ -39,6 +40,7 @@ var SecondaryToolbar = {
|
|||
this.lastPage = options.lastPage;
|
||||
this.pageRotateCw = options.pageRotateCw;
|
||||
this.pageRotateCcw = options.pageRotateCcw;
|
||||
this.documentPropertiesButton = options.documentPropertiesButton;
|
||||
|
||||
// Attach the event listeners.
|
||||
var elements = [
|
||||
|
@ -55,7 +57,9 @@ var SecondaryToolbar = {
|
|||
{ element: this.firstPage, handler: this.firstPageClick },
|
||||
{ element: this.lastPage, handler: this.lastPageClick },
|
||||
{ element: this.pageRotateCw, handler: this.pageRotateCwClick },
|
||||
{ element: this.pageRotateCcw, handler: this.pageRotateCcwClick }
|
||||
{ element: this.pageRotateCcw, handler: this.pageRotateCcwClick },
|
||||
{ element: this.documentPropertiesButton,
|
||||
handler: this.documentPropertiesClick }
|
||||
];
|
||||
|
||||
for (var item in elements) {
|
||||
|
@ -74,17 +78,17 @@ var SecondaryToolbar = {
|
|||
|
||||
openFileClick: function secondaryToolbarOpenFileClick(evt) {
|
||||
document.getElementById('fileInput').click();
|
||||
this.close(evt.target);
|
||||
this.close();
|
||||
},
|
||||
|
||||
printClick: function secondaryToolbarPrintClick(evt) {
|
||||
window.print();
|
||||
this.close(evt.target);
|
||||
this.close();
|
||||
},
|
||||
|
||||
downloadClick: function secondaryToolbarDownloadClick(evt) {
|
||||
PDFView.download();
|
||||
this.close(evt.target);
|
||||
this.close();
|
||||
},
|
||||
|
||||
viewBookmarkClick: function secondaryToolbarViewBookmarkClick(evt) {
|
||||
|
@ -109,6 +113,11 @@ var SecondaryToolbar = {
|
|||
PDFView.rotatePages(-90);
|
||||
},
|
||||
|
||||
documentPropertiesClick: function secondaryToolbarDocumentPropsClick(evt) {
|
||||
this.documentProperties.show();
|
||||
this.close();
|
||||
},
|
||||
|
||||
// Misc. functions for interacting with the toolbar.
|
||||
setMaxHeight: function secondaryToolbarSetMaxHeight(container) {
|
||||
if (!container || !this.buttonContainer) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue