[-] BO : product page - fix accordions not always being correctly initialized
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@12604 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -201,7 +201,9 @@
|
|||||||
displayTabProductById(id, true, 0, null);
|
displayTabProductById(id, true, 0, null);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$("#product-tab-content-"+id).show();
|
$("#product-tab-content-"+id).show(0, function(){
|
||||||
|
$(this).trigger('displayed');
|
||||||
|
});
|
||||||
$("#link-"+id).addClass('selected');
|
$("#link-"+id).addClass('selected');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -127,7 +127,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(document).ready(function() {
|
||||||
var default_is_ok = false;
|
var default_is_ok = false;
|
||||||
|
|
||||||
var manageDefaultSupplier = function() {
|
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() {
|
setTimeout(function() {
|
||||||
$('#suppliers_accordion').accordion();
|
$('#suppliers_accordion').accordion();
|
||||||
}, 500);
|
}, 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>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
<p> </p>
|
<p> </p>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(document).ready(function() {
|
||||||
$('.check_all_warehouse').click(function() {
|
$('.check_all_warehouse').click(function() {
|
||||||
var check = $(this);
|
var check = $(this);
|
||||||
//get all checkboxes of current warehouse
|
//get all checkboxes of current warehouse
|
||||||
@@ -107,10 +107,16 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
setTimeout(function() {
|
// @TODO: a better way to fix the accordion wrong size bug when the selected page is this page
|
||||||
$('#warehouse_accordion').accordion();
|
setTimeout(function() {
|
||||||
}, 500);
|
$('#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>
|
</script>
|
||||||
|
|
||||||
{/if}
|
{/if}
|
||||||
@@ -224,8 +224,9 @@ function editProductAttribute(ids, token)
|
|||||||
function displayTabProductById(id, selected, index, stack)
|
function displayTabProductById(id, selected, index, stack)
|
||||||
{
|
{
|
||||||
var myurl = $('#link-'+id).attr("href")+"&ajax=1";
|
var myurl = $('#link-'+id).attr("href")+"&ajax=1";
|
||||||
|
var tab_selector = $("#product-tab-content-"+id);
|
||||||
// Used to check if the tab is already in the process of being loaded
|
// Used to check if the tab is already in the process of being loaded
|
||||||
$("#product-tab-content-"+id).addClass('loading');
|
tab_selector.addClass('loading');
|
||||||
|
|
||||||
if (selected)
|
if (selected)
|
||||||
$('#product-tab-content-wait').show();
|
$('#product-tab-content-wait').show();
|
||||||
@@ -236,22 +237,24 @@ function displayTabProductById(id, selected, index, stack)
|
|||||||
cache: false, // cache needs to be set to false or IE will cache the page with outdated product values
|
cache: false, // cache needs to be set to false or IE will cache the page with outdated product values
|
||||||
success : function(data)
|
success : function(data)
|
||||||
{
|
{
|
||||||
$("#product-tab-content-"+id).html(data);
|
tab_selector.html(data);
|
||||||
$("#product-tab-content-"+id).removeClass('not-loaded');
|
tab_selector.removeClass('not-loaded');
|
||||||
|
|
||||||
if (selected)
|
if (selected)
|
||||||
{
|
{
|
||||||
$("#link-"+id).addClass('selected');
|
$("#link-"+id).addClass('selected');
|
||||||
$("#product-tab-content-"+id).show();
|
tab_selector.show();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
complete : function(data)
|
complete : function(data)
|
||||||
{
|
{
|
||||||
$("#product-tab-content-"+id).removeClass('loading');
|
$("#product-tab-content-"+id).removeClass('loading');
|
||||||
if (selected)
|
if (selected)
|
||||||
|
{
|
||||||
$('#product-tab-content-wait').hide();
|
$('#product-tab-content-wait').hide();
|
||||||
|
tab_selector.trigger('displayed');
|
||||||
$("#product-tab-content-"+id).trigger('loaded');
|
}
|
||||||
|
tab_selector.trigger('loaded');
|
||||||
if (stack && stack[index + 1])
|
if (stack && stack[index + 1])
|
||||||
displayTabProductById(stack[index + 1], selected, index + 1, stack);
|
displayTabProductById(stack[index + 1], selected, index + 1, stack);
|
||||||
},
|
},
|
||||||
@@ -372,5 +375,4 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Enable writing of the product name when the friendly url field in tab SEO is loaded
|
// Enable writing of the product name when the friendly url field in tab SEO is loaded
|
||||||
onTabLoad('Seo', enableProductName);
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user