github.com/ghodss/etcd@v0.3.1-0.20140417172404-cc329bfa55cb/mod/dashboard/app/scripts/common/directives/highlight.js (about) 1 'use strict'; 2 3 angular.module('etcdControlPanel') 4 .directive('highlight', function(keyPrefix) { 5 return { 6 restrict: 'E', 7 scope: { 8 highlightBase: '=', 9 highlightCurrent: '=' 10 }, 11 link: function(scope, element, attrs) { 12 var base = _.str.strRight(scope.highlightBase, keyPrefix), 13 current = _.str.trim(scope.highlightCurrent, '/'); 14 if (base === current) { 15 element.parent().parent().addClass('etcd-selected'); 16 } 17 } 18 }; 19 });