From 0247550a0af86ad01db3ed7aba3afb612673af58 Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Tue, 24 Sep 2013 17:18:37 +0200 Subject: [PATCH] // Fix accordion for bootsrap and better bulk action for warehouse --- .../controllers/products/warehouses.tpl | 39 ++++++++-------- js/admin-products.js | 46 +++---------------- 2 files changed, 26 insertions(+), 59 deletions(-) diff --git a/admin-dev/themes/default/template/controllers/products/warehouses.tpl b/admin-dev/themes/default/template/controllers/products/warehouses.tpl index 405477943..ae2b91633 100644 --- a/admin-dev/themes/default/template/controllers/products/warehouses.tpl +++ b/admin-dev/themes/default/template/controllers/products/warehouses.tpl @@ -36,9 +36,7 @@

{l s='Please choose the warehouses associated with this product. You must also select a default warehouse. '}

- - {l s='Create a new warehouse'} - + {l s='Create a new warehouse'}
@@ -51,12 +49,15 @@
- - - - - - +
{l s='Stored'}{l s='Product'}{l s='Location (optional)'}
+ + + + + + + + {foreach $attributes AS $index => $attribute} {assign var=location value=''} {assign var=selected value=''} @@ -67,7 +68,7 @@ {/if} {/foreach} - - {/foreach} - - - - {if $attributes|@count gt 1} - - - - - {/if} + {/foreach}
{l s='Stored'}{l s='Product'}{l s='Location (optional)'}
@@ -79,17 +80,15 @@ size="20" />
 
{l s='Mark all products as stored in this warehouse.'}
+ {if $attributes|@count gt 1} + + + {/if}
diff --git a/js/admin-products.js b/js/admin-products.js index 6c4d174d7..1fe79886a 100644 --- a/js/admin-products.js +++ b/js/admin-products.js @@ -1320,25 +1320,6 @@ product_tabs['Suppliers'] = new function(){ //manage default supplier check self.manageDefaultSupplier(); }); - - // @TODO: a better way to fix the accordion wrong size bug when the selected page is this page - setTimeout(function() { - $('#suppliers_accordion').accordion({ - collapsible: true, - autoHeight: true, - heightStyle: "content" - }); - }, 1000); - - // Resize the accordion once the page is visible because of the bug with accordions initialized - // inside a display:none block not having the correct size. - $('#suppliers_accordion').parents('.product-tab-content').bind('displayed', function(){ - $('#suppliers_accordion').accordion({ - collapsible: true, - autoHeight: true, - heightStyle: "content" - }); - }); }; } @@ -1418,9 +1399,9 @@ product_tabs['Warehouses'] = new function(){ this.onReady = function(){ $('.check_all_warehouse').click(function() { - var check = $(this); //get all checkboxes of current warehouse - var checkboxes = $('input[name*="'+check.val()+'"]'); + var checkboxes = $('input[name*="'+$(this).val()+'"]'); + var checked = false; for (i=0; i