From c71d0d3f40293c035ff385a70e76f25898315ecc Mon Sep 17 00:00:00 2001 From: Gordon Smith Date: Sat, 14 Feb 2015 15:06:59 +0000 Subject: [PATCH] GH-211 Use visualization title if it exists Fixes #211 Signed-off-by: Gordon Smith --- widgets/src/marshaller/Graph.js | 2 +- widgets/src/marshaller/HipieDDL.js | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/widgets/src/marshaller/Graph.js b/widgets/src/marshaller/Graph.js index 0341e2c80b..177fb872ad 100644 --- a/widgets/src/marshaller/Graph.js +++ b/widgets/src/marshaller/Graph.js @@ -61,7 +61,7 @@ } newSurface = new ResizeSurface() .size({ width: width, height: height }) - .title(item.id) + .title(item.title) .content(item.widget) ; } diff --git a/widgets/src/marshaller/HipieDDL.js b/widgets/src/marshaller/HipieDDL.js index e5048b63b2..94ccf68382 100644 --- a/widgets/src/marshaller/HipieDDL.js +++ b/widgets/src/marshaller/HipieDDL.js @@ -316,6 +316,7 @@ this.dashboard = dashboard; this.id = visualization.id; this.label = visualization.label; + this.title = visualization.title || visualization.id; this.type = visualization.type; this.properties = visualization.properties || visualization.source.properties || {}; this.source = new Source(this, visualization.source); @@ -334,7 +335,7 @@ this.loadWidget("src/chart/MultiChartSurface", function (widget) { widget .chartType(context.properties.charttype || context.type) - .title(context.id) + .title(context.title) ; }); break; @@ -343,7 +344,7 @@ widget .mode("multi") .chartType(context.properties.charttype || context.type) - .title(context.id) + .title(context.title) ; }); break; @@ -461,10 +462,10 @@ var params = this.source.getOutput().getParams(); if (exists("widget.title", this)) { - this.widget.title(this.id +(params ? " (" +params + ")": "")); + this.widget.title(this.title + (params ? " (" +params + ")": "")); this.widget.render(); } else if (exists("widgetSurface.title", this)) { - this.widgetSurface.title(this.id + (params ? " (" + params + ")" : "")); + this.widgetSurface.title(this.title + (params ? " (" + params + ")" : "")); this.widgetSurface.render(); } else { this.widget.render();