소스 검색

Disable `ctrl` / `shift` zoom when `ctrl` is required for mouse wheel zoom.

pull/952/head
Matthew Petroff 3 년 전
부모
커밋
e601519157
2개의 변경된 파일6개의 추가작업 그리고 1개의 파일을 삭제
  1. +2
    -1
      doc/json-config-parameters.md
  2. +4
    -0
      src/js/pannellum.js

+ 2
- 1
doc/json-config-parameters.md 파일 보기

@@ -101,7 +101,8 @@ If set to `false`, zooming with mouse wheel will be disabled. Defaults to `true`
Can also be set to `fullscreenonly`, in which case it is only enabled when the
viewer is fullscreen. Can also be set to `ctrl`, in which case the `ctrl` key
must be held down to zoom with the mouse wheel (except while the viewer is
fullscreen).
fullscreen); when the `ctrl` key is required for mouse wheel zooming, the use
of `ctrl` / `shift` for zoom control is disabled.


### `doubleClickZoom` (boolean)


+ 4
- 0
src/js/pannellum.js 파일 보기

@@ -1177,6 +1177,10 @@ function onDocumentKeyPress(event) {
// Override default action for keys that are used
if (config.capturedKeyNumbers.indexOf(keynumber) < 0)
return;
if (!fullscreenActive && (keynumber == 16 || keynumber == 17) && config.mouseZoom == 'ctrl')
// Disable ctrl / shift zoom when holding the ctrl key is required for
// scroll wheel zooming
return;
event.preventDefault();
// If escape key is pressed


불러오는 중...
취소
저장