Ed Rooth 4e21405647 fix(dashboard): bugs in key browser and stats page.
Fixed key add, key delete bugs. More refactoring.
2014-02-05 22:40:04 -08:00

20 lines
484 B
JavaScript

'use strict';
angular.module('etcdControlPanel')
.directive('highlight', function(keyPrefix) {
return {
restrict: 'E',
scope: {
highlightBase: '=',
highlightCurrent: '='
},
link: function(scope, element, attrs) {
var base = _.str.strRight(scope.highlightBase, keyPrefix),
current = _.str.trim(scope.highlightCurrent, '/');
if (base === current) {
element.parent().parent().addClass('etcd-selected');
}
}
};
});