Commit edc3837ec6cbc470b76d935dea90a1a42152b119
1 parent
97944aa9
Exists in
staging
and in
7 other branches
fix move block function
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
app/helpers/boxes_helper.rb
@@ -191,7 +191,7 @@ module BoxesHelper | @@ -191,7 +191,7 @@ module BoxesHelper | ||
191 | "before-block-#{block.id}" | 191 | "before-block-#{block.id}" |
192 | end | 192 | end |
193 | if block.nil? or modifiable?(block) | 193 | if block.nil? or modifiable?(block) |
194 | - 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') | 194 | + 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') |
195 | else | 195 | else |
196 | "" | 196 | "" |
197 | end | 197 | end |
@@ -224,9 +224,9 @@ module BoxesHelper | @@ -224,9 +224,9 @@ module BoxesHelper | ||
224 | # FIXME too much hardcoded stuff | 224 | # FIXME too much hardcoded stuff |
225 | if holder.layout_template == 'default' | 225 | if holder.layout_template == 'default' |
226 | if block.box.position == 2 # area 2, left side => move to right side | 226 | if block.box.position == 2 # area 2, left side => move to right side |
227 | - 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' ) | 227 | + 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' ) |
228 | elsif block.box.position == 3 # area 3, right side => move to left side | 228 | elsif block.box.position == 3 # area 3, right side => move to left side |
229 | - 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' ) | 229 | + 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' ) |
230 | end | 230 | end |
231 | end | 231 | end |
232 | 232 |