[Libreoffice-commits] online.git: loleaflet/src

Ozcan Esen ozcan.esen at collabora.com
Sun Jan 3 07:15:23 PST 2016


 loleaflet/src/map/handler/Map.Keyboard.js |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

New commits:
commit 1d83a7809348dd9129fba18cc81f97401d03d77a
Author: Ozcan Esen <ozcan.esen at collabora.com>
Date:   Mon Dec 28 23:42:35 2015 +0200

    loleaflet: change slides with pgup/pgdown in presentation
    
    Change-Id: I83a5a51974b6aaf986e6583318f37ecedd5ee8ff
    Reviewed-on: https://gerrit.libreoffice.org/20994
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Ashod Nakashian <ashnakash at gmail.com>

diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js
index 2ce5bf9..6df4b4c 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -139,6 +139,11 @@ L.Map.Keyboard = L.Handler.extend({
 		46  : true // delete
 	},
 
+	keyCodes: {
+		pageUp:   33,
+		pageDown: 34
+	},
+
 	navigationKeyCodes: {
 		left:    [37],
 		right:   [39],
@@ -234,6 +239,22 @@ L.Map.Keyboard = L.Handler.extend({
 			}
 		}
 
+		// Change slides with PgUp/PgDown in Presentation
+		if (this._map.getDocType() === 'presentation' && !this.modifier && e.type === 'keyup') {
+			var _keyCode = e.originalEvent.keyCode;
+			if (_keyCode === this.keyCodes.pageUp || _keyCode === this.keyCodes.pageDown) {
+				e.originalEvent.preventDefault();
+				e.originalEvent.stopPropagation();
+
+				if (_keyCode === this.keyCodes.pageUp) {
+					this._map.setPart('prev');
+				}
+				else if (_keyCode === this.keyCodes.pageDown) {
+					this._map.setPart('next');
+				}
+			}
+		}
+
 		// page up or page down, handled by this.dopagejump
 		// to jump back to the anchor from footnote/endnote by PgUp
 		// or jump back to the main text from header/footer by PgUp or PgDown


More information about the Libreoffice-commits mailing list