Commit 6f746463158b407becfe8b45d9ba5e227a85c7d7
1 parent
e2ce513c
Exists in
master
and in
29 other branches
Fix javascript for container block edition and enable move left/right
Showing
2 changed files
with
17 additions
and
10 deletions
Show diff stats
plugins/container_block/public/style.css
@@ -2,8 +2,12 @@ | @@ -2,8 +2,12 @@ | ||
2 | float: left; | 2 | float: left; |
3 | } | 3 | } |
4 | 4 | ||
5 | -#content .boxes .container-block .block .icon-down, #content .boxes .container-block .block .icon-down-disabled, #content .boxes .container-block .block .icon-up, #content .boxes .container-block .block .icon-up-disabled { | ||
6 | - display: none; | 5 | +#content .boxes .container-block .block .icon-down, #content .boxes .container-block .block .icon-down-disabled { |
6 | + background-image: url(/designs/icons/default/Tango/16x16/actions/go-next.png); | ||
7 | +} | ||
8 | + | ||
9 | +#content .boxes .container-block .block .icon-up, #content .boxes .container-block .block .icon-up-disabled { | ||
10 | + background-image: url(/designs/icons/default/Tango/16x16/actions/go-previous.png); | ||
7 | } | 11 | } |
8 | 12 | ||
9 | #content .boxes .container-block .block { | 13 | #content .boxes .container-block .block { |
plugins/container_block/views/blocks/container.rhtml
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | <% box_decorator = edit_mode ? self : BoxesHelper::DontMoveBlocks %> | 2 | <% box_decorator = edit_mode ? self : BoxesHelper::DontMoveBlocks %> |
3 | 3 | ||
4 | <% box_decorator.select_blocks(block.blocks, { :article => @page, :request_path => request.path, :locale => locale }).each do |child| %> | 4 | <% box_decorator.select_blocks(block.blocks, { :article => @page, :request_path => request.path, :locale => locale }).each do |child| %> |
5 | - <div class="container_block_child"> | 5 | + <div class="container_block_child" id="container_block_child_<%= block.id %>"> |
6 | <%= display_block(child, '') %> | 6 | <%= display_block(child, '') %> |
7 | </div> | 7 | </div> |
8 | <style>#block-<%=child.id%> { width: <%= block.child_width(child.id) %>px; }</style> | 8 | <style>#block-<%=child.id%> { width: <%= block.child_width(child.id) %>px; }</style> |
@@ -15,20 +15,23 @@ | @@ -15,20 +15,23 @@ | ||
15 | <%= link_to_remote '', :url => { :controller => @controller.boxes_holder.kind_of?(Environment) ? 'container_block_plugin_admin' : 'container_block_plugin_myprofile', :action => 'saveWidths', :id => block.id }, | 15 | <%= link_to_remote '', :url => { :controller => @controller.boxes_holder.kind_of?(Environment) ? 'container_block_plugin_admin' : 'container_block_plugin_myprofile', :action => 'saveWidths', :id => block.id }, |
16 | :with => "containerChildrenWidth(#{block.id})", | 16 | :with => "containerChildrenWidth(#{block.id})", |
17 | :html => {:class => "button icon-save container_block_save", :id => "container_block_save_#{block.id}" }, | 17 | :html => {:class => "button icon-save container_block_save", :id => "container_block_save_#{block.id}" }, |
18 | - :loading => "", | ||
19 | - :loaded => "" %> | 18 | + :loading => "open_loading(DEFAULT_LOADING_MESSAGE);", |
19 | + :loaded => "close_loading();" %> | ||
20 | </div> | 20 | </div> |
21 | 21 | ||
22 | <script> | 22 | <script> |
23 | - function saveWidth(container) { | ||
24 | - } | ||
25 | - | ||
26 | function toggleMoveContainerChildren(container) { | 23 | function toggleMoveContainerChildren(container) { |
27 | - var containerDiv = jQuery('#block-'+container+' .container_block_child .block'); | 24 | + var containerDiv = jQuery('#block-'+container+' #container_block_child_'+container+' > .block'); |
28 | if(containerDiv.is('.ui-resizable')) { | 25 | if(containerDiv.is('.ui-resizable')) { |
29 | containerDiv.resizable('destroy'); | 26 | containerDiv.resizable('destroy'); |
30 | } else { | 27 | } else { |
31 | - containerDiv.resizable({handles: 'e, w'}); | 28 | + containerDiv.resizable({ |
29 | + handles: 'e, w', | ||
30 | + containment: '#block-'+container+' .block-inner-2', | ||
31 | + resize: function( event, ui ) { | ||
32 | + ui.element.height('auto'); | ||
33 | + } | ||
34 | + }); | ||
32 | } | 35 | } |
33 | } | 36 | } |
34 | 37 |