From 0905deec4e2cb4fa7c12b919b5c619da68032cf2 Mon Sep 17 00:00:00 2001 From: Brian Ford Date: Tue, 13 Nov 2012 10:26:45 -0500 Subject: [PATCH] moved instrumentation-enabling ui --- js/controllers/PanelCtrl.js | 19 +++++++++++++++++++ panel.html | 11 ++++++++++- panes/perf.html | 5 +---- 3 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 js/controllers/PanelCtrl.js diff --git a/js/controllers/PanelCtrl.js b/js/controllers/PanelCtrl.js new file mode 100644 index 0000000..9e7c928 --- /dev/null +++ b/js/controllers/PanelCtrl.js @@ -0,0 +1,19 @@ +panelApp.controller('PanelCtrl', function PanelCtrl($scope, appContext) { + + // TODO: remove this (newVal === oldVal ?) + var first = true; + + appContext.getDebug(function (result) { + $scope.enable = result; + + $scope.$watch('enable', function (newVal, oldVal) { + // prevent refresh on initial pageload + if (first) { + first = false; + } else { + appContext.setDebug(newVal); + } + }); + }); + +}); diff --git a/panel.html b/panel.html index b014312..d07112a 100644 --- a/panel.html +++ b/panel.html @@ -41,10 +41,19 @@ + - + + diff --git a/panes/perf.html b/panes/perf.html index c3948a2..bd9aac7 100644 --- a/panes/perf.html +++ b/panes/perf.html @@ -2,15 +2,12 @@

Performance

-
-
+

Watch Tree