Skip to content

Commit

Permalink
Prevent multiple requests from 'done re-ordering'
Browse files Browse the repository at this point in the history
  • Loading branch information
joemsak authored and parndt committed Aug 8, 2010
1 parent 706872a commit fa6fc37
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions public/javascripts/refinery/admin.js
Expand Up @@ -826,8 +826,11 @@ var list_reorder = {
}

, disable_reordering: function(e) {
if($('#reorder_action_done').hasClass('loading')){
return false;
}
if(e) { e.preventDefault(); }

$('#reorder_action_done').addClass('loading');
if (list_reorder.update_url != null) {
serialized = "";
list_reorder.sortable_list.find('> li[id]').each(function(index, li) {
Expand Down Expand Up @@ -877,7 +880,7 @@ var list_reorder = {

$('#site_bar, #header > *:not(script)').fadeTo(250, 1);
$('#actions *:not("#reorder_action_done, #reorder_action")').not($('#reorder_action_done').parents('li, ul')).fadeTo(250, 1, function() {
$('#reorder_action_done').hide();
$('#reorder_action_done').hide().removeClass('loading');
$('#reorder_action').show();
});
}
Expand Down
3 changes: 3 additions & 0 deletions public/stylesheets/refinery/refinery.css
Expand Up @@ -1045,6 +1045,9 @@ a img {
.reorder_icon {
background-image: url('/images/refinery/icons/arrow_switch.png');
}
.reorder_icon.loading{
background-image:url('/images/refinery/icons/ajax-loader.gif');
}
.user_comment_icon {
background-image: url('/images/refinery/icons/user_comment.png');
}
Expand Down

0 comments on commit fa6fc37

Please sign in to comment.