// Changes to ajax tab loading in product page
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@11478 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
@@ -104,7 +104,7 @@
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
displayFlags(languages, id_language, allowEmployeeFormLang);
|
||||
//displayFlags(languages, id_language, allowEmployeeFormLang);
|
||||
$(document).ready(function() {
|
||||
|
||||
$("#addAttachment").live('click', function() {
|
||||
|
||||
@@ -75,10 +75,22 @@
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
var toload = new Array();
|
||||
|
||||
var tabs_preloaded = new Array();
|
||||
$(document).ready(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);
|
||||
});
|
||||
|
||||
{if $is_pack}
|
||||
$('#pack_product').attr('checked', 'checked');
|
||||
|
||||
@@ -42,7 +42,6 @@
|
||||
<script type="text/javascript">
|
||||
var token = '{$token}';
|
||||
var id_product = {if isset($product->id)}{$product->id}{else}0{/if};
|
||||
var tabs_preloaded = new Array();
|
||||
|
||||
{$combinationImagesJs}
|
||||
$(document).ready(function(){
|
||||
@@ -51,21 +50,6 @@
|
||||
updateMvtStatus($(this).val());
|
||||
});
|
||||
updateMvtStatus($(this).val());
|
||||
|
||||
{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);
|
||||
});
|
||||
|
||||
});
|
||||
function updateMvtStatus(id_mvt_reason)
|
||||
{
|
||||
|
||||
@@ -2080,6 +2080,9 @@ class AdminProductsControllerCore extends AdminController
|
||||
if(!method_exists($this, 'initForm'.$this->tab_display))
|
||||
return;
|
||||
|
||||
// Used for loading each tab
|
||||
$this->tpl_form_vars['tabs_preloaded'] = $this->tabs_preloaded;
|
||||
|
||||
$this->addJqueryUI('ui.datepicker');
|
||||
// getLanguages init this->_languages
|
||||
$this->getLanguages();
|
||||
@@ -3116,8 +3119,6 @@ class AdminProductsControllerCore extends AdminController
|
||||
|
||||
$product->tags = Tag::getProductTags($product->id);
|
||||
|
||||
$data->assign('tabs_preloaded', $this->tabs_preloaded);
|
||||
|
||||
// TinyMCE
|
||||
$iso_tiny_mce = $this->context->language->iso_code;
|
||||
$iso_tiny_mce = (file_exists(_PS_JS_DIR_.'tiny_mce/langs/'.$iso_tiny_mce.'.js') ? $iso_tiny_mce : 'en');
|
||||
|
||||
Reference in New Issue
Block a user