|
|
|
@ -25,11 +25,10 @@ var SecondaryToolbar = {
@@ -25,11 +25,10 @@ var SecondaryToolbar = {
|
|
|
|
|
|
|
|
|
|
initialize: function secondaryToolbarInitialize(options) { |
|
|
|
|
this.toolbar = options.toolbar; |
|
|
|
|
this.toggleButton = options.toggleButton; |
|
|
|
|
|
|
|
|
|
this.buttonContainer = this.toolbar.firstElementChild; |
|
|
|
|
|
|
|
|
|
// Define the toolbar buttons.
|
|
|
|
|
this.toggleButton = options.toggleButton; |
|
|
|
|
this.presentationMode = options.presentationMode; |
|
|
|
|
this.openFile = options.openFile; |
|
|
|
|
this.print = options.print; |
|
|
|
@ -40,21 +39,24 @@ var SecondaryToolbar = {
@@ -40,21 +39,24 @@ var SecondaryToolbar = {
|
|
|
|
|
this.pageRotateCcw = options.pageRotateCcw; |
|
|
|
|
|
|
|
|
|
// Attach the event listeners.
|
|
|
|
|
this.toggleButton.addEventListener('click', this.toggle.bind(this)); |
|
|
|
|
|
|
|
|
|
this.presentationMode.addEventListener('click', |
|
|
|
|
this.presentationModeClick.bind(this)); |
|
|
|
|
this.openFile.addEventListener('click', this.openFileClick.bind(this)); |
|
|
|
|
this.print.addEventListener('click', this.printClick.bind(this)); |
|
|
|
|
this.download.addEventListener('click', this.downloadClick.bind(this)); |
|
|
|
|
|
|
|
|
|
this.firstPage.addEventListener('click', this.firstPageClick.bind(this)); |
|
|
|
|
this.lastPage.addEventListener('click', this.lastPageClick.bind(this)); |
|
|
|
|
|
|
|
|
|
this.pageRotateCw.addEventListener('click', |
|
|
|
|
this.pageRotateCwClick.bind(this)); |
|
|
|
|
this.pageRotateCcw.addEventListener('click', |
|
|
|
|
this.pageRotateCcwClick.bind(this)); |
|
|
|
|
var elements = [ |
|
|
|
|
{ element: this.toggleButton, handler: this.toggle }, |
|
|
|
|
{ element: this.presentationMode, handler: this.presentationModeClick }, |
|
|
|
|
{ element: this.openFile, handler: this.openFileClick }, |
|
|
|
|
{ element: this.print, handler: this.printClick }, |
|
|
|
|
{ element: this.download, handler: this.downloadClick }, |
|
|
|
|
{ element: this.firstPage, handler: this.firstPageClick }, |
|
|
|
|
{ element: this.lastPage, handler: this.lastPageClick }, |
|
|
|
|
{ element: this.pageRotateCw, handler: this.pageRotateCwClick }, |
|
|
|
|
{ element: this.pageRotateCcw, handler: this.pageRotateCcwClick } |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
for (var item in elements) { |
|
|
|
|
var element = elements[item].element; |
|
|
|
|
if (element) { |
|
|
|
|
element.addEventListener('click', elements[item].handler.bind(this)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
// Event handling functions.
|
|
|
|
|