Skip to content

Commit

Permalink
Refactored to use new AJAX functionality, which solves most of our is…
Browse files Browse the repository at this point in the history
…sues with importing a feature via AJAX
  • Loading branch information
baphled committed Jun 28, 2010
1 parent a52bde3 commit f5711da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/common/forms/_feature_import.html.erb
@@ -1,5 +1,5 @@
<h3>Feature: <%=h file[:file].sub(/\.feature/,"").gsub(/_/,' ') %></h3>
<%- form_for file[:feature], :id => "new_feature",:class => "new_feature hidden", :method => :post do |f|%>
<%- form_for file[:feature], :html => {:id => "new_feature",:class => "new_feature hidden", :method => :post} do |f|%>
  <fieldset class="ui-tabs ui-widget ui-widget-content ui-corner-all">
<%= hidden_field_tag :commit, 'Import' %>
<%= hidden_field_tag :current_project_id, current_project.id %>
Expand Down
10 changes: 9 additions & 1 deletion app/views/features/import.rjs.erb
@@ -1,2 +1,10 @@
var accOpts = {
event: "click",
autoHeight: false,
fillSpace: false,
navigation: true
}
$('div#wrapper').html("<%= escape_javascript(render :partial => '/common/project_import', :locals => {:current_project => @current_project}) %>");
$('#content').renderFlashMessage({flashMessage:"<%=escape_javascript(flash.delete(:notice)) %>"});
$('#content-wide').renderFlashMessage({flashMessage:"<%=escape_javascript(flash.delete(:notice)) %>"});
$('#myTabs').tabs();
$('ul.accordion').accordion(accOpts);

0 comments on commit f5711da

Please sign in to comment.