Add specific sub-filters on warnings in the timeline

This commit is contained in:
Gaël Métais
2015-05-22 17:44:54 +02:00
parent 701530ef04
commit 1ff983a03b
6 changed files with 102 additions and 11 deletions
+8
View File
@@ -4,6 +4,14 @@ timelineCtrl.controller('TimelineCtrl', ['$scope', '$rootScope', '$routeParams',
$scope.runId = $routeParams.runId;
$scope.Menu = Menu.setCurrentPage('timeline', $scope.runId);
$scope.warningsFilterOn = false;
$scope.warningsFilters = {
queryWithoutResults: true,
jQueryCallOnEmptyObject: true,
eventNotDelegated: true,
jsError: true
};
function loadResults() {
// Load result if needed
if (!$rootScope.loadedResult || $rootScope.loadedResult.runId !== $routeParams.runId) {
+14 -1
View File
@@ -766,10 +766,23 @@
element.append(getProfilerLineHTML(scope.index, scope.node));
element[0].id = 'line_' + scope.index;
if (scope.node.warning || scope.node.error) {
if (scope.node.warning) {
element[0].classList.add('warning');
if (scope.node.queryWithoutResults) {
element[0].classList.add('queryWithoutResults');
}
if (scope.node.jQueryCallOnEmptyObject) {
element[0].classList.add('jQueryCallOnEmptyObject');
}
if (scope.node.eventNotDelegated) {
element[0].classList.add('eventNotDelegated');
}
}
// Bind click on the details icon
var detailsIcon = element[0].querySelector('.details div');
if (detailsIcon) {