[-] BO : fix bug #PSCFV-341 - ajax call could be made twice for the same product tab
This commit is contained in:
@@ -148,15 +148,15 @@
|
|||||||
$("#product-tab-content-"+currentId).hide();
|
$("#product-tab-content-"+currentId).hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($("#product-tab-content-"+id).hasClass('not-loaded') && !$("#product-tab-content-"+id).hasClass('loading'))
|
// if the tab has not already been loaded, load it now
|
||||||
tabs_manager.display(id, true, 0, null);
|
tabs_manager.display(id, true, 0, null);
|
||||||
else
|
|
||||||
{
|
tabs_manager.onLoad(id, function(){
|
||||||
$("#product-tab-content-"+id).show(0, function(){
|
$("#product-tab-content-"+id).show(0, function(){
|
||||||
$(this).trigger('displayed');
|
$(this).trigger('displayed');
|
||||||
});
|
});
|
||||||
$("#link-"+id).addClass('selected');
|
$("#link-"+id).addClass('selected');
|
||||||
}
|
});
|
||||||
|
|
||||||
var languages = new Array();
|
var languages = new Array();
|
||||||
if (btn_name == "Combinations")
|
if (btn_name == "Combinations")
|
||||||
|
|||||||
@@ -75,9 +75,13 @@ function ProductTabsManager(){
|
|||||||
*/
|
*/
|
||||||
this.display = function (id, selected, index, stack)
|
this.display = function (id, selected, index, stack)
|
||||||
{
|
{
|
||||||
var myurl = $('#link-'+id).attr("href")+"&ajax=1";
|
|
||||||
var tab_selector = $("#product-tab-content-"+id);
|
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');
|
tab_selector.addClass('loading');
|
||||||
|
|
||||||
if (selected)
|
if (selected)
|
||||||
@@ -89,7 +93,7 @@ function ProductTabsManager(){
|
|||||||
data = post_data;
|
data = post_data;
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : myurl,
|
url : $('#link-'+id).attr("href")+"&ajax=1",
|
||||||
async : true,
|
async : true,
|
||||||
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
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
|
|||||||
Reference in New Issue
Block a user