[-] 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:
@@ -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")
|
||||
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user