diff --git a/web/hand_tool.js b/web/hand_tool.js index 987e11d1f..cd4b3054a 100644 --- a/web/hand_tool.js +++ b/web/hand_tool.js @@ -25,6 +25,9 @@ var HandTool = { this.handTool = new GrabToPan({ element: options.container, onActiveChanged: function(isActive) { + if (!toggleHandTool) { + return; + } if (isActive) { toggleHandTool.title = mozL10n.get('hand_tool_disable.title', null, 'Disable hand tool'); @@ -36,9 +39,11 @@ var HandTool = { toggleHandTool.firstElementChild.textContent = mozL10n.get('hand_tool_enable_label', null, 'Enable hand tool'); } - } + } }); - toggleHandTool.addEventListener('click', this.handTool.toggle, false); + if (toggleHandTool) { + toggleHandTool.addEventListener('click', this.handTool.toggle, false); + } // TODO: Read global prefs and call this.handTool.activate() if needed. }, diff --git a/web/secondary_toolbar.js b/web/secondary_toolbar.js index aff0c2b75..c9375823d 100644 --- a/web/secondary_toolbar.js +++ b/web/secondary_toolbar.js @@ -41,7 +41,10 @@ var SecondaryToolbar = { // Attach the event listeners. var elements = [ + // Button to toggle the visibility of the secondary toolbar: { element: this.toggleButton, handler: this.toggle }, + // All items within the secondary toolbar + // (except for toggleHandTool, hand_tool.js is responsible for it): { element: this.presentationModeButton, handler: this.presentationModeClick }, { element: this.openFile, handler: this.openFileClick },