// refactor product attribute ajax actions
git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@13439 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
+17
-15
@@ -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'));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user