fix 'vanishing' custom widgets - order_blocks should only be executed once per drag and drop, not twice

pull/6827/head
Tim Felgentreff 13 years ago
parent f8ae55a9eb
commit 5b49ea5fbf
  1. 5
      app/controllers/my_projects_overviews_controller.rb

@ -95,8 +95,9 @@ class MyProjectsOverviewsController < ApplicationController
group = params[:group]
if group.is_a?(String)
group_items = (params["list-#{group}"] || []).collect {|x| param_to_block(x) }
if group_items and group_items.is_a? Array
# remove group blocks if they are presents in other groups
if group_items.size > @overview.send(group).size
# We are adding, not removing
# Remove group blocks if they are presents in other groups
@overview.update_attributes('top' => (@overview.top - group_items),
'left' => (@overview.left - group_items),
'right' => (@overview.right - group_items),

Loading…
Cancel
Save