Commit 1c2d98272357b907e3a6a6474e3ad11655990e85
1 parent
e4f4a29d
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Improve box organizer
Showing
2 changed files
with
5 additions
and
3 deletions
Show diff stats
app/helpers/boxes_helper.rb
| @@ -201,7 +201,9 @@ module BoxesHelper | @@ -201,7 +201,9 @@ module BoxesHelper | ||
| 201 | 201 | ||
| 202 | # makes the given block draggable so it can be moved away. | 202 | # makes the given block draggable so it can be moved away. |
| 203 | def block_handle(block) | 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 | end | 207 | end |
| 206 | 208 | ||
| 207 | def block_draggable(element_id, options={}) | 209 | def block_draggable(element_id, options={}) |
| @@ -212,7 +214,7 @@ module BoxesHelper | @@ -212,7 +214,7 @@ module BoxesHelper | ||
| 212 | :revertDuration => 200, | 214 | :revertDuration => 200, |
| 213 | :scroll => false, | 215 | :scroll => false, |
| 214 | :start => "function() {$('#box-organizer').addClass('shadow')}", | 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 | }.merge(options) | 218 | }.merge(options) |
| 217 | draggable_element(element_id, draggable_options) | 219 | draggable_element(element_id, draggable_options) |
| 218 | end | 220 | end |
public/stylesheets/block-store.css
| @@ -66,7 +66,7 @@ | @@ -66,7 +66,7 @@ | ||
| 66 | margin-right: auto; | 66 | margin-right: auto; |
| 67 | margin-left: auto; | 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 | display: inline-block; | 70 | display: inline-block; |
| 71 | height: auto; | 71 | height: auto; |
| 72 | z-index: 100; | 72 | z-index: 100; |