Files
stackviz/app/js/directives/test-details-search.js
Austin Clark 093c02d0b9 Fix lint errors and update eslint
Fixes a couple of lint errors caught by `npm run lint` in timeline-
overview.js and timeline-viewport.js. Also restructures the test-
details controller to use appropriate `this.` syntax instead of
`$scope.`

In addition, eslint and eslint-config-openstack have been updated,
and a new .eslintrc.json config file has been created to tweak some
specific rules for stackviz.

Change-Id: I9e1fe5121621730eb3efda4b99e9fe182f399aee
2016-02-04 13:52:12 -07:00

46 lines
1.1 KiB
JavaScript

'use strict';
var directivesModule = require('./_index.js');
/**
* @ngInject
*/
function testDetailsSearch() {
/**
* @ngInject
*/
var controller = function($scope, $element) {
var self = this;
this.open = false;
this.showINFO = true;
this.showDEBUG = true;
this.showWARNING = true;
this.showERROR = true;
var update = function() {
$scope.filter(self.showINFO, self.showDEBUG, self.showWARNING, self.showERROR);
};
$scope.$watch(function() { return self.query; }, update);
$scope.$watch(function() { return self.showINFO; }, update);
$scope.$watch(function() { return self.showDEBUG; }, update);
$scope.$watch(function() { return self.showWARNING; }, update);
$scope.$watch(function() { return self.showERROR; }, update);
};
return {
restrict: 'EA',
require: ['^testDetailsSearch','^testDetails'],
scope: {
'filter': '='
},
controller: controller,
controllerAs: 'search',
templateUrl: 'directives/test-details-search.html',
transclude: true
};
}
directivesModule.directive('testDetailsSearch', testDetailsSearch);