Преглед на файлове

Merge pull request #63 from dpq/master

Added option to disable keyboard zooming
pull/70/head
Matthew Petroff преди 9 години
родител
ревизия
6c9daa82ec
променени са 2 файла, в които са добавени 10 реда и са изтрити 4 реда
  1. +5
    -0
      doc/json-config-parameters.md
  2. +5
    -4
      src/js/pannellum.js

+ 5
- 0
doc/json-config-parameters.md Целия файл

@@ -75,6 +75,11 @@ CSS.
If set to `false`, the zoom controls will not be displayed. Defaults to `true`.


### `keyboardZoom`

If set to `false`, zooming with keyboard will be disabled. Defaults to `true`.


### `showFullscreenCtrl`

If set to `false`, the fullscreen control will not be displayed. Defaults to


+ 5
- 4
src/js/pannellum.js Целия файл

@@ -70,7 +70,8 @@ var defaultConfig = {
type: 'equirectangular',
northOffset: 0,
showFullscreenCtrl: true,
video: false
video: false,
keyboardZoom: true
};

container.className += ' container';
@@ -742,12 +743,12 @@ function keyRepeat() {
diff = Math.min(diff, 1.0);
// If minus key is down
if (keysDown[0]) {
if (keysDown[0] && config.keyboardZoom == true) {
setHfov(config.hfov + (zoomSpeed * 0.8 + 0.5) * diff);
}
// If plus key is down
if (keysDown[1]) {
if (keysDown[1] && config.keyboardZoom == true) {
setHfov(config.hfov + (zoomSpeed * 0.8 - 0.2) * diff);
}
@@ -1309,7 +1310,7 @@ function processOptions() {
controls.zoom.style.display = 'none';
}
break;
case 'showFullscreenCtrl':
if (config[key] && ('fullscreen' in document || 'mozFullScreen' in document ||
'webkitIsFullScreen' in document || 'msFullscreenElement' in document)) {


Зареждане…
Отказ
Запис