commit/galaxy-central: guerler: Charts: Fix configure button in viewport
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/f86086c92a22/ Changeset: f86086c92a22 User: guerler Date: 2014-01-23 04:21:14 Summary: Charts: Fix configure button in viewport Affected #: 1 file diff -r fd6cd92888edf53c86378e3ec36dae1e0cf54884 -r f86086c92a2291e11bd1d76afa67b9166a8dc0ee config/plugins/visualizations/charts/static/views/viewport.js --- a/config/plugins/visualizations/charts/static/views/viewport.js +++ b/config/plugins/visualizations/charts/static/views/viewport.js @@ -61,15 +61,30 @@ }, // show - show: function(id) { + show: function(chart_id) { // hide all this.$el.find('svg').hide(); - var item = this.list[id]; + // identify selected item from list + var item = this.list[chart_id]; if (item) { // show selected chart this.$el.find(item.svg_id).show(); + // get chart + var chart = self.app.charts.get(chart_id); + + // update portlet + this.portlet.label(chart.get('title')); + this.portlet.setOperation('edit', function() { + // get chart + self.app.chart.copy(chart); + + // show edit + self.app.charts_view.$el.hide(); + self.app.chart_view.$el.show(); + }); + // this trigger d3 update events $(window).trigger('resize'); } @@ -83,23 +98,11 @@ // backup chart details var chart_id = chart.id; - // update portlet - this.portlet.label(chart.get('title')); - this.portlet.setOperation('edit', function() { - // get chart - var chart = self.app.charts.get(chart_id); - self.app.chart.copy(chart); - - // show edit - self.app.charts_view.$el.hide(); - self.app.chart_view.$el.show(); - }); - // make sure that svg does not exist already - this._removeChart(chart.id); + this._removeChart(chart_id); // create id - var svg_id = '#svg_' + chart.id; + var svg_id = '#svg_' + chart_id; // create element var chart_el = $(this._template({id: svg_id, height : this.options.height})); @@ -108,7 +111,7 @@ this.portlet.append(chart_el); // backup id - this.list[chart.id] = { + this.list[chart_id] = { svg_id : svg_id } @@ -155,8 +158,8 @@ chart_index++; }); - // add view - self.list[chart.id].view = view; + // show + self.show(chart_id); }); }, Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org