[-] BO : fix bug #PSCFV-341 - ajax call could be made twice for the same product tab

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@15065 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2012-05-04 08:55:16 +00:00
parent 04e5b13367
commit c6be7c30d9
2 changed files with 12 additions and 8 deletions
@@ -148,15 +148,15 @@
$("#product-tab-content-"+currentId).hide();
}
if ($("#product-tab-content-"+id).hasClass('not-loaded') && !$("#product-tab-content-"+id).hasClass('loading'))
tabs_manager.display(id, true, 0, null);
else
{
// if the tab has not already been loaded, load it now
tabs_manager.display(id, true, 0, null);
tabs_manager.onLoad(id, function(){
$("#product-tab-content-"+id).show(0, function(){
$(this).trigger('displayed');
});
$("#link-"+id).addClass('selected');
}
});
var languages = new Array();
if (btn_name == "Combinations")
+7 -3
View File
@@ -75,9 +75,13 @@ function ProductTabsManager(){
*/
this.display = function (id, selected, index, stack)
{
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
// Is the tab already being loaded?
if (!tab_selector.hasClass('not-loaded') || tab_selector.hasClass('loading'))
return;
// Mark the tab as being currently loading
tab_selector.addClass('loading');
if (selected)
@@ -89,7 +93,7 @@ function ProductTabsManager(){
data = post_data;
$.ajax({
url : myurl,
url : $('#link-'+id).attr("href")+"&ajax=1",
async : true,
cache: false, // cache needs to be set to false or IE will cache the page with outdated product values
type: 'POST',