Commit 1c2d98272357b907e3a6a6474e3ad11655990e85

Authored by Victor Costa
1 parent e4f4a29d

Improve box organizer

app/helpers/boxes_helper.rb
... ... @@ -201,7 +201,9 @@ module BoxesHelper
201 201  
202 202 # makes the given block draggable so it can be moved away.
203 203 def block_handle(block)
204   - modifiable?(block) ? block_draggable("block-#{block.id}") : ""
  204 + return "" unless modifiable?(block)
  205 + block_draggable("block-#{block.id}",
  206 + :helper => "function(){$(this).addClass('ui-draggable-dragging'); return '#{display_icon(block.class)}'}")
205 207 end
206 208  
207 209 def block_draggable(element_id, options={})
... ... @@ -212,7 +214,7 @@ module BoxesHelper
212 214 :revertDuration => 200,
213 215 :scroll => false,
214 216 :start => "function() {$('#box-organizer').addClass('shadow')}",
215   - :stop => "function() {$('#box-organizer').removeClass('shadow')}"
  217 + :stop => "function() {$('#box-organizer').removeClass('shadow'); $('.ui-draggable-dragging').removeClass('ui-draggable-dragging')}"
216 218 }.merge(options)
217 219 draggable_element(element_id, draggable_options)
218 220 end
... ...
public/stylesheets/block-store.css
... ... @@ -66,7 +66,7 @@
66 66 margin-right: auto;
67 67 margin-left: auto;
68 68 }
69   -#block-store-draggables .block-type, #block-store-draggables .block {
  69 +#block-store-draggables .block-type, #block-store-draggables .block, #block-store-draggables .block-type-icon {
70 70 display: inline-block;
71 71 height: auto;
72 72 z-index: 100;
... ...