// adding the dynamic loading of tabs in products

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11124 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2011-12-12 11:15:17 +00:00
parent 345ad40e3c
commit c0fae8aa5c
3 changed files with 40 additions and 25 deletions
+2 -15
View File
@@ -74,21 +74,8 @@
$("#product-tab-content-wait").show(); $("#product-tab-content-wait").show();
if ($("#product-tab-content-"+id).hasClass('not-loaded') || $(this).hasClass('selected')) if ($("#product-tab-content-"+id).hasClass('not-loaded'))
{ displayTabProductById(this, id, true);
myurl = $(this).attr("href")+"&ajax=1";
$.ajax({
url : myurl,
async : true,
success :function(data)
{
$("#product-tab-content-"+id).html(data);
$("#product-tab-content-"+id).removeClass('not-loaded');
$("#product-tab-content-"+id).show();
$("#link-"+id).addClass('selected');
}
});
}
else else
{ {
$("#product-tab-content-"+id).show(); $("#product-tab-content-"+id).show();
@@ -37,6 +37,14 @@
updateMvtStatus($(this).val()); updateMvtStatus($(this).val());
}); });
updateMvtStatus($(this).val()); updateMvtStatus($(this).val());
$('.product-tab-content').each(function(){
var id = $(this).attr('id').substr(20);
if ($("#product-tab-content-"+id).hasClass('not-loaded'))
displayTabProductById('#link-'+id, id, false);
});
}); });
function updateMvtStatus(id_mvt_reason) function updateMvtStatus(id_mvt_reason)
{ {
@@ -621,8 +629,8 @@ var accessories = new Array();
</table> </table>
<br /> <br />
</div> </div>
{*
<script type="text/javascript"> <script type="text/javascript">
toggleVirtualProduct(getE('is_virtual_good')); toggleVirtualProduct(getE('is_virtual_good'));
</script> </script>*}
+20
View File
@@ -204,6 +204,26 @@ function editProductAttribute(ids, token)
} }
/* END Combination */ /* END Combination */
function displayTabProductById(el, id, selected)
{
myurl = $(el).attr("href")+"&ajax=1";
$.ajax({
url : myurl,
async : true,
success :function(data)
{
$("#product-tab-content-"+id).html(data);
$("#product-tab-content-"+id).removeClass('not-loaded');
if (selected)
{
$("#link-"+id).addClass('selected');
$("#product-tab-content-"+id).show();
}
}
});
}
function addPackItem() function addPackItem()
{ {
if ($('#curPackItemId').val() == '' || $('#curPackItemName').val() == '') if ($('#curPackItemId').val() == '' || $('#curPackItemName').val() == '')