[-] BO : product page - fix accordions not always being correctly initialized

This commit is contained in:
tDidierjean
2012-01-23 14:19:33 +00:00
parent 530c100225
commit 13cd1c5395
4 changed files with 31 additions and 14 deletions
@@ -201,7 +201,9 @@
displayTabProductById(id, true, 0, null);
else
{
$("#product-tab-content-"+id).show();
$("#product-tab-content-"+id).show(0, function(){
$(this).trigger('displayed');
});
$("#link-"+id).addClass('selected');
}
@@ -127,7 +127,7 @@
</div>
<script type="text/javascript">
$(function() {
$(document).ready(function() {
var default_is_ok = false;
var manageDefaultSupplier = function() {
@@ -192,9 +192,16 @@
});
// @TODO: a better way to fix the accordion wrong size bug when the selected page is this page
setTimeout(function() {
$('#suppliers_accordion').accordion();
}, 500);
// 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("resize");
});
});
</script>
@@ -86,7 +86,7 @@
<p>&nbsp;</p>
<script type="text/javascript">
$(function() {
$(document).ready(function() {
$('.check_all_warehouse').click(function() {
var check = $(this);
//get all checkboxes of current warehouse
@@ -107,10 +107,16 @@
}
});
setTimeout(function() {
$('#warehouse_accordion').accordion();
}, 500);
// @TODO: a better way to fix the accordion wrong size bug when the selected page is this page
setTimeout(function() {
$('#warehouse_accordion').accordion();
}, 500);
// 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("resize");
});
});
</script>
{/if}