moved instrumentation-enabling ui

test-unit-sauce
Brian Ford 12 years ago
parent 34adac7951
commit 0905deec4e

@ -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);
}
});
});
});

@ -41,10 +41,19 @@
<script src="js/controllers/DepsCtrl.js"></script>
<script src="js/controllers/ModelCtrl.js"></script>
<script src="js/controllers/OptionsCtrl.js"></script>
<script src="js/controllers/PanelCtrl.js"></script>
<script src="js/controllers/PerfCtrl.js"></script>
</head>
<body>
<body ng-controller="PanelCtrl">
<label class="checkbox" for="enable-instrumentation">
<input type="checkbox" ng-model="enable" id="enable-instrumentation">
Enable
<span class="label label-important">
Causes refresh
<i class="icon-refresh icon-white"></i>
</span>
</label>
<bat-tabs>
<bat-pane title="Models" src="panes/model.html"></bat-pane>
<bat-pane title="Performance" src="panes/perf.html"></bat-pane>

@ -2,15 +2,12 @@
<h2>Performance</h2>
<form class="well form-inline" class="row-fluid">
<label class="checkbox span4" for="extra">
<input type="checkbox" ng-model="enable" id="extra"> Enable <span class="label label-important">Causes tab to refresh <i class="icon-refresh icon-white"></i></span>
</label>
<label class="checkbox span4" for="log">
<input type="checkbox" ng-model="log" id="log"> Log to console
</label>
</form>
<div ng-hide="!enable" class="row-fluid">
<div class="row-fluid">
<div class="span6">
<h3>Watch Tree</h3>
<div class="well well-top" style="height: 400px; overflow-y: auto;">