From 7cfa2cd086994c942b4372e0137f3d49a9e84618 Mon Sep 17 00:00:00 2001 From: lLefevre Date: Sun, 1 Jan 2012 15:20:27 +0000 Subject: [PATCH] // add loading tab product --- admin-dev/themes/default/css/admin.css | 2 ++ admin-dev/themes/default/template/products/form.tpl | 7 +++---- controllers/admin/AdminProductsController.php | 2 +- js/admin-products.js | 5 +++++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/admin-dev/themes/default/css/admin.css b/admin-dev/themes/default/css/admin.css index d42ba6ead..44aa178c1 100644 --- a/admin-dev/themes/default/css/admin.css +++ b/admin-dev/themes/default/css/admin.css @@ -135,6 +135,8 @@ input.button[disabled=disabled]:hover{background-color:#FFF6D3} .table tr.last td{border-bottom:none} td.col-left {vertical-align:top; padding-right:10px;} #tabPane1 td.col-left { width:200px;} +#product-tab-content-wait{display:block;background:url('../img/bg_loaderSpace.png');z-index:100;margin-left:140px;min-height:404px;padding:5px 10px 10px;} +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;} .alt_row{background-color:#f8f8f8} .path_bar{background-color:#E2EBEE;border:1px solid #999999;font-family:Trebuchet,Arial,Helvetica,sans-serif;font-size:13px;margin-bottom:20px;padding:5px} diff --git a/admin-dev/themes/default/template/products/form.tpl b/admin-dev/themes/default/template/products/form.tpl index 41c97e2ef..61bc564ec 100644 --- a/admin-dev/themes/default/template/products/form.tpl +++ b/admin-dev/themes/default/template/products/form.tpl @@ -177,7 +177,6 @@ $("#product-tab-content-"+currentId).hide(); } - $("#product-tab-content-wait").show(); if ($("#product-tab-content-"+id).hasClass('not-loaded') && !$("#product-tab-content-"+id).hasClass('loading')) displayTabProductById(this, id, true); else @@ -185,7 +184,6 @@ $("#product-tab-content-"+id).show(); $("#link-"+id).addClass('selected'); } - $("#product-tab-content-wait").hide(); var languages = new Array(); if (btn_name == "Combinations") @@ -234,7 +232,9 @@ tb_pathToImage = "../img/loadingAnimation.gif"; //]]> - + + +
@@ -250,7 +250,6 @@
{/if} {* all input are here *} - {foreach $product_tabs key=numStep item=tab}
{if $tab.selected} diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 438a62993..6a27f808d 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -3889,7 +3889,7 @@ class AdminProductsControllerCore extends AdminController $this->addJqueryUI(array( 'ui.core', 'ui.widget', - 'ui.accordion' + 'ui.accordion' )); $this->addJS(array( diff --git a/js/admin-products.js b/js/admin-products.js index 103131f54..086d32894 100644 --- a/js/admin-products.js +++ b/js/admin-products.js @@ -220,6 +220,10 @@ function displayTabProductById(el, id, selected) myurl = $(el).attr("href")+"&ajax=1"; // Used to check if the tab is already in the process of being loaded $("#product-tab-content-"+id).addClass('loading'); + + if (selected) + $('#product-tab-content-wait').show(); + $.ajax({ url : myurl, async : true, @@ -237,6 +241,7 @@ function displayTabProductById(el, id, selected) complete : function(data) { $("#product-tab-content-"+id).removeClass('loading'); + $('#product-tab-content-wait').hide(); } }); }