diff options
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb | 21 | ||||
-rw-r--r-- | sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb | 14 |
2 files changed, 22 insertions, 13 deletions
diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb index ae05758e1ca..dd951d22941 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/_widget_properties.html.erb @@ -1,8 +1,17 @@ -<% form_remote_tag :url => {:action => :save_widget, :wid => widget.id, :id => params[:id]}, - :method => :post, - :update => {:failure => "error#{widget.id}"}, - :failure => "$('error#{widget.id}').show()", - :id => "form-edit-#{widget.key.parameterize}" do -%> +<form onsubmit="$j.ajax + ({ + url: '<%= ApplicationController.root_context-%>/dashboard/save_widget?wid=<%=widget.id-%>', + type: 'post', + data: $j(this).serialize(), + error: function(request) + { + $j('#error<%=widget.id-%>').text(request.responseText); + $j('#error<%=widget.id-%>').show(); + }, + }); + return false;" + method="post" + action="<%= ApplicationController.root_context-%>/dashboard/save_widget?wid=<%=widget.id-%>"> <div id="error<%= widget.id -%>" class="error" style="display: none"></div> <table class="table width100"> <tbody> @@ -56,4 +65,4 @@ </tbody> </table> <%= hidden_field_tag "widgetid", "", :class => "widgetid" %> -<% end -%> +</form> diff --git a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb index 137945150f1..3b6aeb0f3e0 100644 --- a/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb +++ b/sonar-server/src/main/webapp/WEB-INF/app/views/dashboard/configure.html.erb @@ -70,12 +70,12 @@ Event.observe(window, 'load', init_dashboard, false); function filterWidgetsByCategory(category) { - new Ajax.Updater( - 'widget_defs', - '<%= add_category_to_url(url_for dashboard_action(:widget_definitions)) -%>' + encodeURIComponent(category), - {asynchronous:true, evalScripts:true}); - $('filter-widgets-loading').show(); - return false; + $j('#filter-widgets-loading').show(); + $j.ajax ({ url: '<%= add_category_to_url(url_for dashboard_action(:widget_definitions)) -%>' + encodeURIComponent(category), + success: function(responseHTML){$j('#widget_defs').html(responseHTML);}, + error:function(error){alert('error');}, + }); + return false; } var widgetContents = [ @@ -106,5 +106,5 @@ } //--> - $('filter-widget-box').focus(); + $j('#filter-widget-box').focus(); </script> |