From edc3837ec6cbc470b76d935dea90a1a42152b119 Mon Sep 17 00:00:00 2001 From: Leandro Nunes dos Santos Date: Wed, 25 Feb 2015 13:12:09 -0300 Subject: [PATCH] fix move block function --- app/helpers/boxes_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/boxes_helper.rb b/app/helpers/boxes_helper.rb index e1fd4a1..1b33e71 100644 --- a/app/helpers/boxes_helper.rb +++ b/app/helpers/boxes_helper.rb @@ -191,7 +191,7 @@ module BoxesHelper "before-block-#{block.id}" end if block.nil? or modifiable?(block) - content_tag('div', ' ', :id => id, :class => 'block-target' ) + drop_receiving_element(id, :url => { :action => 'move_block', :target => id }, :accept => box.acceptable_blocks, :hoverclass => 'block-target-hover') + content_tag('div', ' ', :id => id, :class => 'block-target' ) + drop_receiving_element(id, :url => { :action => 'add_or_move_block', :target => id }, :accept => box.acceptable_blocks, :hoverclass => 'block-target-hover') else "" end @@ -224,9 +224,9 @@ module BoxesHelper # FIXME too much hardcoded stuff if holder.layout_template == 'default' if block.box.position == 2 # area 2, left side => move to right side - buttons << icon_button('right', _('Move to the opposite side'), { :action => 'move_block', :target => 'end-of-box-' + holder.boxes[2].id.to_s, :id => block.id }, :method => 'post' ) + buttons << icon_button('right', _('Move to the opposite side'), { :action => 'add_or_move_block', :target => 'end-of-box-' + holder.boxes[2].id.to_s, :id => block.id }, :method => 'post' ) elsif block.box.position == 3 # area 3, right side => move to left side - buttons << icon_button('left', _('Move to the opposite side'), { :action => 'move_block', :target => 'end-of-box-' + holder.boxes[1].id.to_s, :id => block.id }, :method => 'post' ) + buttons << icon_button('left', _('Move to the opposite side'), { :action => 'add_or_move_block', :target => 'end-of-box-' + holder.boxes[1].id.to_s, :id => block.id }, :method => 'post' ) end end -- libgit2 0.21.2