Updated Branches:
  refs/heads/trunk 41c2d3ec8 -> 0dfd27ea0

AMBARI-3245. Incorrect behavior of dashboard graphs. (onechiporenko)


Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/0dfd27ea
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/0dfd27ea
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/0dfd27ea

Branch: refs/heads/trunk
Commit: 0dfd27ea025f851be0ec4286b6c1803342d55913
Parents: 41c2d3e
Author: Oleg Nechiporenko <[email protected]>
Authored: Mon Sep 16 15:15:26 2013 +0300
Committer: Oleg Nechiporenko <[email protected]>
Committed: Mon Sep 16 15:21:27 2013 +0300

----------------------------------------------------------------------
 .../app/views/common/chart/linear_time.js       | 23 +++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0dfd27ea/ambari-web/app/views/common/chart/linear_time.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/chart/linear_time.js 
b/ambari-web/app/views/common/chart/linear_time.js
index e0e892d..59e53b1 100644
--- a/ambari-web/app/views/common/chart/linear_time.js
+++ b/ambari-web/app/views/common/chart/linear_time.js
@@ -86,6 +86,8 @@ App.ChartLinearTimeView = Ember.View.extend({
 
   _seriesProperties: null,
 
+  _seriesPropertiesWidget: null,
+
   renderer: 'area',
 
   popupSuffix: '-popup',
@@ -623,7 +625,7 @@ App.ChartLinearTimeView = Ember.View.extend({
       });
       _graph.update();
 
-      $('li.line').click(function() {
+      $('#'+self.get('id')+'-container'+self.get('popupSuffix')+' 
li.line').click(function() {
         var series = [];
         $('#'+self.get('id')+'-container'+self.get('popupSuffix')+' 
a.action').each(function(index, v) {
           series[index] = v.parentNode.classList;
@@ -634,6 +636,25 @@ App.ChartLinearTimeView = Ember.View.extend({
       this.set('_popupGraph', _graph);
     }
     else {
+
+      _graph.series.forEach(function(series, index) {
+        if (self.get('_seriesPropertiesWidget') !== null && 
self.get('_seriesPropertiesWidget')[index] !== null && 
self.get('_seriesPropertiesWidget')[index] !== undefined ) {
+          
if(self.get('_seriesPropertiesWidget')[self.get('_seriesPropertiesWidget').length
 - index - 1].length > 1) {
+            $('#'+self.get('id')+'-container'+' 
a.action:eq('+(self.get('_seriesPropertiesWidget').length - index - 
1)+')').parent('li').addClass('disabled');
+            series.disable();
+          }
+        }
+      });
+      _graph.update();
+
+      $('#'+self.get('id')+'-container'+' li.line').click(function() {
+        var series = [];
+        $('#'+self.get('id')+'-container'+' a.action').each(function(index, v) 
{
+          series[index] = v.parentNode.classList;
+        });
+        self.set('_seriesPropertiesWidget', series);
+      });
+
       this.set('_graph', _graph);
     }
   },

Reply via email to