loleaflet: change slides with pgup/pgdown in presentation

Change-Id: I83a5a51974b6aaf986e6583318f37ecedd5ee8ff
Reviewed-on: https://gerrit.libreoffice.org/20994
Reviewed-by: Ashod Nakashian <ashnakash@gmail.com>
Tested-by: Ashod Nakashian <ashnakash@gmail.com>
This commit is contained in:
Ozcan Esen 2015-12-28 23:42:35 +02:00 committed by Ashod Nakashian
parent cc1861a6a8
commit 1d83a78093

View file

@ -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