diff --git a/admin-dev/themes/default/template/controllers/products/combination/helpers/list/list_action_default.tpl b/admin-dev/themes/default/template/controllers/products/combination/helpers/list/list_action_default.tpl deleted file mode 100644 index 6cf2b9fe3..000000000 --- a/admin-dev/themes/default/template/controllers/products/combination/helpers/list/list_action_default.tpl +++ /dev/null @@ -1,28 +0,0 @@ -{* -* 2007-2011 PrestaShop -* -* NOTICE OF LICENSE -* -* This source file is subject to the Academic Free License (AFL 3.0) -* that is bundled with this package in the file LICENSE.txt. -* It is also available through the world-wide-web at this URL: -* http://opensource.org/licenses/afl-3.0.php -* If you did not receive a copy of the license and are unable to -* obtain it through the world-wide-web, please send an email -* to license@prestashop.com so we can send you a copy immediately. -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade PrestaShop to newer -* versions in the future. If you wish to customize PrestaShop for your -* needs please refer to http://www.prestashop.com for more information. -* -* @author PrestaShop SA -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 9197 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*} - - {$action} - \ No newline at end of file diff --git a/admin-dev/themes/default/template/controllers/products/combination/helpers/list/list_action_delete.tpl b/admin-dev/themes/default/template/controllers/products/combination/helpers/list/list_action_delete.tpl deleted file mode 100644 index fa753b7b5..000000000 --- a/admin-dev/themes/default/template/controllers/products/combination/helpers/list/list_action_delete.tpl +++ /dev/null @@ -1,28 +0,0 @@ -{* -* 2007-2011 PrestaShop -* -* NOTICE OF LICENSE -* -* This source file is subject to the Academic Free License (AFL 3.0) -* that is bundled with this package in the file LICENSE.txt. -* It is also available through the world-wide-web at this URL: -* http://opensource.org/licenses/afl-3.0.php -* If you did not receive a copy of the license and are unable to -* obtain it through the world-wide-web, please send an email -* to license@prestashop.com so we can send you a copy immediately. -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade PrestaShop to newer -* versions in the future. If you wish to customize PrestaShop for your -* needs please refer to http://www.prestashop.com for more information. -* -* @author PrestaShop SA -* @copyright 2007-2011 PrestaShop SA -* @version Release: $Revision: 9197 $ -* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) -* International Registered Trademark & Property of PrestaShop SA -*} - - {$action} - \ No newline at end of file diff --git a/admin-dev/themes/default/template/helpers/list/list_action_default.tpl b/admin-dev/themes/default/template/helpers/list/list_action_default.tpl index a4fa50937..4b11f302d 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_default.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_default.tpl @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} - + {$action} \ No newline at end of file diff --git a/admin-dev/themes/default/template/helpers/list/list_action_delete.tpl b/admin-dev/themes/default/template/helpers/list/list_action_delete.tpl index af051feff..93557da7f 100644 --- a/admin-dev/themes/default/template/helpers/list/list_action_delete.tpl +++ b/admin-dev/themes/default/template/helpers/list/list_action_delete.tpl @@ -23,6 +23,6 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} - + {$action} \ No newline at end of file diff --git a/js/admin-products.js b/js/admin-products.js index 0993a0176..d05feed48 100644 --- a/js/admin-products.js +++ b/js/admin-products.js @@ -55,16 +55,12 @@ function addButtonCombination(item) posC = true; } -function deleteProductAttribute(ids, token, parent) +function deleteProductAttribute(url, parent) { - var id = ids.split('||'); $.ajax({ - url: 'index.php', + url: url, data: { - id_product: id[0], - id_product_attribute: id[1], - controller: 'AdminProducts', - token: token, + id_product: id_product, action: 'deleteProductAttribute', ajax: true }, @@ -76,7 +72,7 @@ function deleteProductAttribute(ids, token, parent) if (data.status == 'ok') { showSuccessMessage(data.message); - parent.hide(); + parent.remove(); } else showErrorMessage(data.message); @@ -84,16 +80,12 @@ function deleteProductAttribute(ids, token, parent) }); } -function defaultProductAttribute(ids, token, parent) +function defaultProductAttribute(url, parent) { - var id = ids.split('||'); $.ajax({ - url: 'index.php', + url: url, data: { - id_product: id[0], - id_product_attribute: id[1], - controller: 'AdminProducts', - token: token, + id_product: id_product, action: 'defaultProductAttribute', ajax: true }, @@ -449,5 +441,15 @@ $(document).ready(function() { e.preventDefault(); editProductAttribute(this.href, $(this).closest('tr')); }); + + $('table[name=list_table]').delegate('a.delete', 'click', function(e){ + e.preventDefault(); + deleteProductAttribute(this.href, $(this).closest('tr')); + }); + + $('table[name=list_table]').delegate('a.default', 'click', function(e){ + e.preventDefault(); + defaultProductAttribute(this.href, $(this).closest('tr')); + }); }); });