[Sahara] Fixed tab selection in case of processes names conflict

We need to have delimeters around service name because it is
possible that one process name is a substring of another process
name (e.g. 'namenode' and 'secondarynamenode'). Implemented the
easiest fix by adding delimeters currently used in data-target
attribute.

Change-Id: Iae734d5f2f34f492fe12a566ed636fd7ad525851
Closes-Bug: #1398695
This commit is contained in:
Andrew Lazarev 2014-12-18 17:13:54 -08:00 committed by Nikita Konovalov
parent 47a5df7dfe
commit c7354a144f

View File

@ -12,7 +12,7 @@
addHorizonLoadEvent(function () {
function get_service_tab(service) {
return $("a").filter(function (idx, e) {
return $(e).attr("data-target") && $(e).attr("data-target").indexOf(service.toLowerCase()) != -1
return $(e).attr("data-target") && $(e).attr("data-target").indexOf('_'+service.toLowerCase()+'-') != -1
}).closest("li");
}