Skip to content

Commit

Permalink
Fix some link_to_remote + form_to_remote. Add Form.spinnable :remote …
Browse files Browse the repository at this point in the history
…=> true behavior
  • Loading branch information
Thomas Lecavelier committed Oct 16, 2013
1 parent 929afe2 commit 1a36690
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/helpers/admin/feedback_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ def filter_link(text, filter='', style='')

def change_status(item, context='listing')
status = (item.state.to_s.downcase =~ /spam/) ? :ham : :spam
link_to_remote(_("Flag as %s", status.to_s), :url => {:controller => 'admin/feedback',:action => 'change_state', :id => item.id, :context => context})
link_to(_("Flag as %s", status.to_s), :url => {:controller => 'admin/feedback',:action => 'change_state', :id => item.id, :context => context}, :remote => true)
end
end
2 changes: 1 addition & 1 deletion app/views/admin/content/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<% end %>
<%= form_remote_tag url: {action: 'index'}, method: :get, name: 'article', update: {:success => 'articleList'}, before: "Element.show('spinner')", complete: "Element.hide('spinner')" do %>
<%= form_tag url: {action: 'index'}, method: :get, name: 'article', remote: true, :class => 'spinnable', :"data-update-success" => 'articleList' do %>
<% if params[:search] and params[:search]['state'] %>
<input type='hidden' name="search[state]" value="<%= params[:search]['state'] %>" >
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/administration.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="imagetoolbar" content="no" />
<%= stylesheet_link_tag "growler", "bootstrap", "administration_structure", "lightbox", "jquery-ui" %>
<%= javascript_include_tag "jquery", "jquery_ujs", "jquery-ui", "bootstrap", "publify", "publify_jquery", "lightbox", "growler", "publify_carousel", "administration" %>
<%= javascript_include_tag "jquery", "jquery_ujs", "jquery-ui", "bootstrap", "publify", "publify_jquery", "lightbox", "growler", "publify_carousel", "administration", "administration_jquery" %>
<style type="text/css">
#carousel-content .slide { width: <%= this_blog.image_thumb_size %>; }
@font-face {
Expand Down
4 changes: 4 additions & 0 deletions public/javascripts/administration_jquery.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$(document).ready(function(){
$('form.spinnable').on('ajax:before', function(evt, xhr, status){ $('#spinner').show();})
$('form.spinnable').on('ajax:after', function(evt, xhr, status){ $('#spinner').hide();})
});

0 comments on commit 1a36690

Please sign in to comment.