From 6bae36adf3bfa707bca20e620759f989f329dc4e Mon Sep 17 00:00:00 2001 From: Evan Theurer Date: Fri, 19 Dec 2014 11:57:52 +0100 Subject: [PATCH] Keep Firefox window from scrolling right when using the right arrow key in presentations. --- static/js/directives/presentation.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/static/js/directives/presentation.js b/static/js/directives/presentation.js index b89e50de2..6b3dbe599 100644 --- a/static/js/directives/presentation.js +++ b/static/js/directives/presentation.js @@ -740,6 +740,16 @@ define(['jquery', 'underscore', 'text!partials/presentation.html', 'bigscreen'], }); }); + $(document).on("keydown", function(event) { + if (!$scope.layout.presentation) { + return; + } + if ($(event.target).is("input,textarea,select")) { + return; + } + event.preventDefault(); + }); + $scope.$watch("layout.presentation", function(newval, oldval) { if (newval && !oldval) { $scope.showPresentation();