Commit 26b6b855 authored by Evgeny Zhlobo's avatar Evgeny Zhlobo

Add F5 hotkey

parent 4f62967b
...@@ -483,7 +483,7 @@ window.shower = (function(window, document, undefined) { ...@@ -483,7 +483,7 @@ window.shower = (function(window, document, undefined) {
}, false); }, false);
document.addEventListener('keydown', function (e) { document.addEventListener('keydown', function (e) {
// Shortcut for alt, shift and meta keys // Shortcut for alt, ctrl and meta keys
if (e.altKey || e.ctrlKey || e.metaKey) { return; } if (e.altKey || e.ctrlKey || e.metaKey) { return; }
var currentSlideNumber = shower.getCurrentSlideNumber(), var currentSlideNumber = shower.getCurrentSlideNumber(),
...@@ -491,6 +491,30 @@ window.shower = (function(window, document, undefined) { ...@@ -491,6 +491,30 @@ window.shower = (function(window, document, undefined) {
switch (e.which) { switch (e.which) {
case 116: // F5 case 116: // F5
e.preventDefault();
if (shower.isListMode()) {
var slideNumber = e.shiftKey ? currentSlideNumber : 0;
shower.go(slideNumber);
if (isHistoryApiSupported) {
history.pushState(null, null, url.pathname + '?full' + shower.getSlideHash(slideNumber));
}
shower.enterSlideMode();
shower.updateProgress(slideNumber);
shower.updateCurrentAndPassedSlides(slideNumber);
shower.runSlideshowIfPresented(slideNumber);
} else {
if (isHistoryApiSupported) {
history.pushState(null, null, url.pathname + shower.getSlideHash(currentSlideNumber));
}
shower.enterListMode();
shower.scrollToSlide(currentSlideNumber);
}
break;
case 13: // Enter case 13: // Enter
if (shower.isListMode() && -1 !== currentSlideNumber) { if (shower.isListMode() && -1 !== currentSlideNumber) {
e.preventDefault(); e.preventDefault();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment