From 3963fc5dec420eb1aa6ce9c7db6cd3b5d8a3053f Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Thu, 26 Jul 2012 11:35:30 -0700 Subject: [PATCH] PerfCtrl code cleanup --- js/controllers/PerfCtrl.js | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/js/controllers/PerfCtrl.js b/js/controllers/PerfCtrl.js index 9958a17..f3ff9cf 100644 --- a/js/controllers/PerfCtrl.js +++ b/js/controllers/PerfCtrl.js @@ -13,6 +13,9 @@ panelApp.controller('PerfCtrl', function PerfCtrl($scope, appContext, filesystem filesystem.exportJSON('file.json', $scope.histogram); }; + // TODO: remove this (newVal === oldVal ?) + var first = true; + appContext.getDebug(function (result) { $scope.enable = result; @@ -23,21 +26,15 @@ panelApp.controller('PerfCtrl', function PerfCtrl($scope, appContext, filesystem } else { appContext.setDebug(newVal); } - if (newVal) { - //updateTimeline(); - updateHistogram(); - } }); }); - var first = true; - $scope.$watch('log', function (newVal, oldVal) { appContext.setLog(newVal); - - appContext.watchRefresh(function () { - appContext.setLog(newVal); - }); + }); + + appContext.watchRefresh(function () { + appContext.setLog(newVal); }); $scope.inspect = function () {