// update call loading page in AdminProductsController

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11996 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
lLefevre
2012-01-02 14:25:39 +00:00
parent 8c2c9507cf
commit 4e9e2c0676
3 changed files with 31 additions and 21 deletions
+1 -1
View File
@@ -136,7 +136,7 @@ input.button[disabled=disabled]:hover{background-color:#FFF6D3}
.table tr.last td{border-bottom:none} .table tr.last td{border-bottom:none}
td.col-left {vertical-align:top; padding-right:10px;} td.col-left {vertical-align:top; padding-right:10px;}
#tabPane1 td.col-left { width:200px;} #tabPane1 td.col-left { width:200px;}
#product-tab-content-wait{display:block;background:url('../img/bg_loaderSpace.png');margin-left:140px;min-height:600px;padding:5px 10px 10px;} #product-tab-content-wait{display:block;background:url('../img/bg_loaderSpace.png');position:absolute;width:100%;z-index:100;min-height:600px;padding:5px 10px 10px;}
div#loading{height:128px;width:128px;background:url('../img/ajax-loader.gif');display:block;text-indent:-9999px;margin:100px auto;} div#loading{height:128px;width:128px;background:url('../img/ajax-loader.gif');display:block;text-indent:-9999px;margin:100px auto;}
td.col-left label { display:block; width:100%; text-align:right;} td.col-left label { display:block; width:100%; text-align:right;}
.alt_row{background-color:#f8f8f8} .alt_row{background-color:#f8f8f8}
@@ -64,7 +64,7 @@
{block name="defaultForm"} {block name="defaultForm"}
<div> <div>
<div class="productTabs"> <div class="productTabs" style="display:none;">
<ul class="tab"> <ul class="tab">
{foreach $product_tabs key=numStep item=tab} {foreach $product_tabs key=numStep item=tab}
<li class="tab-row"> <li class="tab-row">
@@ -76,23 +76,11 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var toload = new Array(); var toload = new Array();
var tabs_preloaded = new Array(); $('#product-tab-content-wait').show();
$(document).ready(function() $(document).ready(function()
{ {
{foreach $tabs_preloaded as $k => $tab} $('#product-tab-content-wait').show();
tabs_preloaded['{$k}'] = '{$tab}';
{/foreach}
$('.product-tab-content').each(function(){
var id = $(this).attr('id').substr(20);
var split_position = id.indexOf('-') + 1;
var btn_name = id.substr(split_position);
if (tabs_preloaded[btn_name])
if ($("#product-tab-content-"+id).hasClass('not-loaded'))
displayTabProductById('#link-'+id, id, false);
});
{if $is_pack} {if $is_pack}
$('#pack_product').attr('checked', 'checked'); $('#pack_product').attr('checked', 'checked');
$('li.tab-row a[id*="VirtualProduct"]').hide(); $('li.tab-row a[id*="VirtualProduct"]').hide();
@@ -217,6 +205,27 @@
}); });
}); });
var tabs_preloaded = new Array();
$(window).bind("load", function() {
{foreach $tabs_preloaded as $k => $tab}
tabs_preloaded['{$k}'] = '{$tab}';
{/foreach}
$('.product-tab-content').each(function(){
var id = $(this).attr('id').substr(20);
var split_position = id.indexOf('-') + 1;
var btn_name = id.substr(split_position);
if (tabs_preloaded[btn_name])
if ($("#product-tab-content-"+id).hasClass('not-loaded'))
displayTabProductById('#link-'+id, id, false);
});
$('.productTabs').show();
$('#product_form').show();
$('#product-tab-content-wait').hide();
});
</script> </script>
{***********************************************} {***********************************************}
@@ -235,7 +244,7 @@
<div id="product-tab-content-wait" style="display:none"><div id="loading">{l s='Loading...'}</div></div> <div id="product-tab-content-wait" style="display:none"><div id="loading">{l s='Loading...'}</div></div>
<form id="product_form" action="{$form_action}" method="post" enctype="multipart/form-data" name="product"> <form id="product_form" action="{$form_action}" method="post" enctype="multipart/form-data" name="product" style="display:none;">
<input type="hidden" name="id_product" value="{$id_product}" /> <input type="hidden" name="id_product" value="{$id_product}" />
<div class="tab-pane" id="tabPane1"> <div class="tab-pane" id="tabPane1">
{if !$product->active} {if !$product->active}
+4 -3
View File
@@ -221,8 +221,8 @@ function displayTabProductById(el, id, selected)
// Used to check if the tab is already in the process of being loaded // Used to check if the tab is already in the process of being loaded
$("#product-tab-content-"+id).addClass('loading'); $("#product-tab-content-"+id).addClass('loading');
if (selected) if (selected)
$('#product-tab-content-wait').show(); $('#product-tab-content-wait').show();
$.ajax({ $.ajax({
url : myurl, url : myurl,
@@ -241,7 +241,8 @@ function displayTabProductById(el, id, selected)
complete : function(data) complete : function(data)
{ {
$("#product-tab-content-"+id).removeClass('loading'); $("#product-tab-content-"+id).removeClass('loading');
$('#product-tab-content-wait').hide(); if (selected)
$('#product-tab-content-wait').hide();
} }
}); });
} }