From c6d3545b8bdaa244ef355e80ef0014b7dadc0686 Mon Sep 17 00:00:00 2001 From: Jerome Nadaud Date: Tue, 13 Aug 2013 17:14:57 +0200 Subject: [PATCH] [-] BO :FixBug Suppliers and Warehouses accordion --- js/admin-products.js | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/js/admin-products.js b/js/admin-products.js index 92c85c4eb..9f67664cd 100644 --- a/js/admin-products.js +++ b/js/admin-products.js @@ -1296,13 +1296,10 @@ product_tabs['Suppliers'] = new function(){ // @TODO: a better way to fix the accordion wrong size bug when the selected page is this page setTimeout(function() { - $('#suppliers_accordion').accordion(); - // If one second was not enough to display page, another resize is needed - setTimeout(function() { - $('#suppliers_accordion').accordion({ - collapsible: true, - autoHeight: true}); - }, 3000); + $('#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 @@ -1310,7 +1307,8 @@ product_tabs['Suppliers'] = new function(){ $('#suppliers_accordion').parents('.product-tab-content').bind('displayed', function(){ $('#suppliers_accordion').accordion({ collapsible: true, - autoHeight: true}); + autoHeight: true, + heightStyle: "content"}); }); }; } @@ -1412,13 +1410,19 @@ product_tabs['Warehouses'] = new function(){ // @TODO: a better way to fix the accordion wrong size bug when the selected page is this page setTimeout(function() { - $('#warehouse_accordion').accordion(); - }, 500); + $('#warehouse_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. $('#warehouse_accordion').parents('.product-tab-content').bind('displayed', function(){ - $('#warehouse_accordion').accordion("refresh"); + $('#warehouse_accordion').accordion({ + collapsible: true, + autoHeight: true, + heightStyle: "content"}); }); }; }