From a4b75601b661f30137b8eb1555a52bb0aec3bf58 Mon Sep 17 00:00:00 2001 From: lLefevre Date: Mon, 12 Dec 2011 11:15:17 +0000 Subject: [PATCH] // adding the dynamic loading of tabs in products --- admin-dev/themes/template/products/form.tpl | 33 ++++++------------- .../themes/template/products/informations.tpl | 12 +++++-- js/admin-products.js | 20 +++++++++++ 3 files changed, 40 insertions(+), 25 deletions(-) diff --git a/admin-dev/themes/template/products/form.tpl b/admin-dev/themes/template/products/form.tpl index 0fd5dacac..3d795378b 100644 --- a/admin-dev/themes/template/products/form.tpl +++ b/admin-dev/themes/template/products/form.tpl @@ -39,26 +39,26 @@ + *} diff --git a/js/admin-products.js b/js/admin-products.js index fe872c453..2c338f90e 100644 --- a/js/admin-products.js +++ b/js/admin-products.js @@ -204,6 +204,26 @@ function editProductAttribute(ids, token) } /* 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() { if ($('#curPackItemId').val() == '' || $('#curPackItemName').val() == '')