mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
20 lines
484 B
JavaScript
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');
|
|
}
|
|
}
|
|
};
|
|
});
|