[Ovirt-devel] [PATCH] Fix broken js cause by svg widget.

Jason Guiditta jguiditt at redhat.com
Thu Aug 14 03:12:11 UTC 2008


This just disables the calls to svg widget within any flexigrids, which is the cause of checkboxes not appearing, details not showing, and other such unpleasantness.  Next step would be to replace these bits with css bar graphs, which will hopefully make it in shortly, but as this breakage is annoying, thought I would do a quick fix.

Also, slightly changed mmorsi's check to bypass apache for dev so it is still ised with production settings, but not in test or development.
---
 wui/src/app/controllers/application.rb    |    2 +-
 wui/src/app/views/graph/_load_graph.rhtml |   16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/wui/src/app/controllers/application.rb b/wui/src/app/controllers/application.rb
index eacf6f3..5ad209f 100644
--- a/wui/src/app/controllers/application.rb
+++ b/wui/src/app/controllers/application.rb
@@ -34,7 +34,7 @@ class ApplicationController < ActionController::Base
   before_filter :authorize_admin, :only => [:new, :create, :edit, :update, :destroy]
 
   def get_login_user
-    if ENV["RAILS_ENV"] != 'test'
+    if ENV["RAILS_ENV"] == 'production'
         user_from_principal(request.env["HTTP_X_FORWARDED_USER"])
     else
         'ovirtadmin'
diff --git a/wui/src/app/views/graph/_load_graph.rhtml b/wui/src/app/views/graph/_load_graph.rhtml
index f6827b2..6678e90 100644
--- a/wui/src/app/views/graph/_load_graph.rhtml
+++ b/wui/src/app/views/graph/_load_graph.rhtml
@@ -5,10 +5,10 @@ function load_widget(div, target){
   var id = $(div).html();
   $(div).html('');
   $(div).addClass("load_graph");
-  $(div).svg();
-  var svg = svgManager.getSVGFor(div);
+  //$(div).svg();
+  //var svg = svgManager.getSVGFor(div);
   var params = { id:1, type:"json", timeframe:"7 days", isJSON:true};
-  $.getJSON("<%= url_for :controller => 'graph', :action => 'load_graph_data' %>/" + id + "?target=" + target, params,
+  /*$.getJSON("<%= url_for :controller => 'graph', :action => 'load_graph_data' %>/" + id + "?target=" + target, params,
              function(response){
                   svg.graph.noDraw();
                    svg.graph.chartFormat('white', 'white').
@@ -25,10 +25,10 @@ function load_widget(div, target){
                    svg.graph.legend.show(false);
                    svg.graph.redraw();
              }
-   );
+   );*/
 //   $(div).children().filter("svg").attr('height', 25).attr('width', 200);
-   $(div).children().filter("svg").attr("height").baseVal.value = 25;
-   $(div).children().filter("svg").attr("width").baseVal.value = 200;
+   //$(div).children().filter("svg").attr("height").baseVal.value = 25;
+   //$(div).children().filter("svg").attr("width").baseVal.value = 200;
 };
 
 // invoked when a row containing a load widgit is selected
@@ -38,11 +38,11 @@ function toggle_load_widget(div, state){
     color = '#D5EFFC'; 
   }
     
-  var graph = svgManager.getSVGFor(div).graph;
+  /*var graph = svgManager.getSVGFor(div).graph;
   graph.noDraw().chartFormat(color, color);
   graph.xAxis.line(color, 0);
   graph.yAxis.line(color, 0);
-  graph.redraw();
+  graph.redraw();*/
 };
 
 function load_widget_select(selected_row)
-- 
1.5.5.1




More information about the ovirt-devel mailing list