Implement hand tool

The logic for the hand tool is implemented in a separate project,
maintained at https://github.com/Rob--W/grab-to-pan.js

Integration notes
- Added toggle as an entry under the Secondary toolbar
- Added shortcut "h" to toggle hand tool (to-do: document this in wiki
  after merge). This shortcut is also used in Adobe's Acrobat Reader.

To-do: localizations for:
hand_tool_enable.title=
hand_tool_enable_label=
hand_tool_disable.title=
hand_tool_disable_label=

To-do (wish): persistence of hand tool preference, preferably a global setting.

secondaryToolbarButton-handTool.png created by Stephen Horlander <shorlander@mozilla.com>
This commit is contained in:
Rob Wu 2013-10-02 22:09:43 +02:00
parent f0c830dba2
commit 3914768085
10 changed files with 330 additions and 2 deletions

View file

@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* globals PDFView, scrollIntoView */
/* globals PDFView, scrollIntoView, HandTool */
'use strict';
@ -103,6 +103,7 @@ var PresentationMode = {
window.addEventListener('contextmenu', this.contextMenu, false);
this.showControls();
HandTool.enterPresentationMode();
this.contextMenuOpen = false;
this.container.setAttribute('contextmenu', 'viewerContextMenu');
},
@ -121,6 +122,7 @@ var PresentationMode = {
this.hideControls();
this.args = null;
PDFView.clearMouseScrollState();
HandTool.exitPresentationMode();
this.container.removeAttribute('contextmenu');
this.contextMenuOpen = false;