Repository: incubator-griffin Updated Branches: refs/heads/master d32dde1f3 -> b82702e00
change the name of id in sidebar It can not be recognized by css when the id contains space , so I change it in order to show the chart in sidebar. Author: dodobel <1254288...@qq.com> Closes #176 from dodobel/merge. Project: http://git-wip-us.apache.org/repos/asf/incubator-griffin/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-griffin/commit/b82702e0 Tree: http://git-wip-us.apache.org/repos/asf/incubator-griffin/tree/b82702e0 Diff: http://git-wip-us.apache.org/repos/asf/incubator-griffin/diff/b82702e0 Branch: refs/heads/master Commit: b82702e00868eefe216915ff3064fca176a2d18e Parents: d32dde1 Author: dodobel <1254288...@qq.com> Authored: Wed Nov 8 17:08:47 2017 +0800 Committer: Lionel Liu <bhlx3l...@163.com> Committed: Wed Nov 8 17:08:47 2017 +0800 ---------------------------------------------------------------------- .../src/app/sidebar/sidebar.component.html | 2 +- ui/angular/src/app/sidebar/sidebar.component.ts | 22 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/b82702e0/ui/angular/src/app/sidebar/sidebar.component.html ---------------------------------------------------------------------- diff --git a/ui/angular/src/app/sidebar/sidebar.component.html b/ui/angular/src/app/sidebar/sidebar.component.html index 8f92f3e..34bd1d3 100644 --- a/ui/angular/src/app/sidebar/sidebar.component.html +++ b/ui/angular/src/app/sidebar/sidebar.component.html @@ -70,7 +70,7 @@ under the License. </a> </h4> </div> - <div id={{outerItems.name+i}} class="panel-collapse collapse" > + <div id="side{{parent}}{{i}}" class="panel-collapse collapse" > <div class="panel-body" style="cursor:pointer;padding:0px 15px;border-top-width: 0;"> <div id="chart{{parent}}-{{i}}" class="side-chart" echarts [options]="getOption(parent,i)" ></div> http://git-wip-us.apache.org/repos/asf/incubator-griffin/blob/b82702e0/ui/angular/src/app/sidebar/sidebar.component.ts ---------------------------------------------------------------------- diff --git a/ui/angular/src/app/sidebar/sidebar.component.ts b/ui/angular/src/app/sidebar/sidebar.component.ts index fcd2d7a..225421c 100644 --- a/ui/angular/src/app/sidebar/sidebar.component.ts +++ b/ui/angular/src/app/sidebar/sidebar.component.ts @@ -94,16 +94,16 @@ export class SidebarComponent implements OnInit { } draw (metric, parentIndex, index) { - $('#'+this.oData[parentIndex].name+index).toggleClass('collapse'); - var chartId = 'chart' + parentIndex + '-' + index; - document.getElementById(chartId).style.width = ($('.panel-heading').innerWidth()-40)+'px'; - document.getElementById(chartId).style.height = '200px'; - this.chartOption.set(chartId,this.chartService.getOptionSide(metric)); - var self = this; - $('#'+chartId).unbind('click'); - $('#'+chartId).click(function(e) { - self.router.navigate(['/detailed/'+self.oData[parentIndex].metrics[index].name]) ; - }); + $('#side'+parentIndex+index).toggleClass('collapse'); + var chartId = 'chart' + parentIndex + '-' + index; + document.getElementById(chartId).style.width = ($('.panel-heading').innerWidth()-40)+'px'; + document.getElementById(chartId).style.height = '200px'; + this.chartOption.set(chartId,this.chartService.getOptionSide(metric)); + var self = this; + $('#'+chartId).unbind('click'); + $('#'+chartId).click(function(e) { + self.router.navigate(['/detailed/'+self.oData[parentIndex].metrics[index].name]) ; + }); }; getOption(parent,i){ @@ -164,7 +164,7 @@ export class SidebarComponent implements OnInit { this.finalData.push(node); this.orgs.push(orgNode); } - this.oData = this.finalData.slice(0); + this.oData = this.finalData.slice(0); }); }