From 14aa9e4004ae8d17e818e14ec6e5c9af520adc90 Mon Sep 17 00:00:00 2001 From: Chris Houseknecht Date: Wed, 13 Aug 2014 16:26:54 -0400 Subject: [PATCH] Job details https://trello.com/c/i4MeikiL/266-unable-to-select-play-after-job-completes When play button clicked to resume live event processing an additional draw loop (setInterval) was being started. Multiple draw loops might be running at the end of the job, and only the most one was gettings stopped. The others kept running. User would click a play, the screen would be repainted one or more times by the remaining draw loops, seleting the first play and irst task in the list regardless of the user selection. Fixed by always checking for and killing the current draw loop before starting a new one. --- awx/ui/static/js/controllers/JobDetail.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/awx/ui/static/js/controllers/JobDetail.js b/awx/ui/static/js/controllers/JobDetail.js index 26116c5da8..8341fd49e7 100644 --- a/awx/ui/static/js/controllers/JobDetail.js +++ b/awx/ui/static/js/controllers/JobDetail.js @@ -169,6 +169,9 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar } else { api_complete = true; //trigger events to start processing + if ($rootScope.jobDetailInterval) { + window.clearInterval($rootScope.jobDetailInterval); + } $rootScope.jobDetailInterval = setInterval(function() { UpdateDOM({ scope: scope }); }, 2000);