From 94a58afbdfcb8f3a711a250f3ae7da6b2cd7ad36 Mon Sep 17 00:00:00 2001 From: FinnStutzenstein Date: Fri, 18 Aug 2017 11:55:52 +0200 Subject: [PATCH] Scroll improvement --- openslides/core/static/js/core/projector.js | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/openslides/core/static/js/core/projector.js b/openslides/core/static/js/core/projector.js index d12459208..c12b36b5e 100644 --- a/openslides/core/static/js/core/projector.js +++ b/openslides/core/static/js/core/projector.js @@ -227,28 +227,9 @@ angular.module('OpenSlidesApp.core.projector', ['OpenSlidesApp.core']) }); }; - // This function scrolls the projector smoothly. It scrolls is steps calling each - // step with a little timeout. - var STEPS = 5; $scope.scroll = 0; var setScroll = function (scroll) { - scroll = -250 * scroll; - if ($scope.scrollTimeout) { - $timeout.cancel($scope.scrollTimeout); - } - var oldScroll = $scope.scroll; - var diff = scroll - oldScroll; - var count = 0; - if (scroll !== oldScroll) { - var scrollFunction = function () { - $scope.scroll += diff/STEPS; - count++; - if (count < STEPS) { - $scope.scrollTimeout = $timeout(scrollFunction, 1); - } - }; - scrollFunction(); - } + $scope.scroll = -250 * scroll; }; $scope.$watch(function () {