}
breadCrumbEntries=function(){
- var curBrowseViewModel=self;
- var entries=[];
- do{
- entries.push(curBrowseViewModel.groupId);
- curBrowseViewModel=curBrowseViewModel.parentBrowseViewModel;
- if (!curBrowseViewModel) return entries.reverse();
- }while(curBrowseViewModel.parentBrowseViewModel)
- return entries.reverse();
+ // root level ?
+ if (!self.parentBrowseViewModel) return [];
+
+ var splitted = self.groupId.split(".");
+ var breadCrumbEntries=[];
+ var curGroupId;
+ for (var i=0;i<splitted.length;i++){
+ curGroupId+=splitted[i];
+ breadCrumbEntries.push(new BreadCrumbEntry(curGroupId,splitted[i]));
+ curGroupId+="."
+ }
+ return breadCrumbEntries;
}
+
+
}
findParentGroupId=function(browseViewModel){
this.project=project;
}
+ BreadCrumbEntry=function(groupId,displayValue){
+ this.groupId=groupId;
+ this.displayValue=displayValue;
+ }
+
//-----------------------------------------
// search part
//-----------------------------------------
<ul class="breadcrumb">
<li><a href="#" data-bind="click: function(){ browseRoot()}"><i class="icon-home"/> </a> <span class="divider">/</span></li>
{{each(i,breadCrumbEntry) breadCrumbEntries}}
- <li><a href="#">${breadCrumbEntry}</a> <span class="divider">/</span></li>
+ <li data-bind="click: function(){displayGroupId(breadCrumbEntry.groupId)}">
+ <a href="#">${breadCrumbEntry.displayValue}</a> <span class="divider">/</span>
+ </li>
{{/each}}
</ul>
</script>
\ No newline at end of file