// fix products

This commit is contained in:
Kevin Granger
2013-10-18 18:38:02 +02:00
parent 316f10a352
commit 5f52a9e171
17 changed files with 220 additions and 185 deletions
+9 -9
View File
@@ -632,7 +632,7 @@ product_tabs['Associations'] = new function(){
var $nameAccessories = $('#nameAccessories');
/* delete product from select + add product line to the div, input_name, input_ids elements */
$divAccessories.html($divAccessories.html() + productName + ' <span class="delAccessory" name="' + productId + '" style="cursor: pointer;"><img src="../img/admin/delete.gif" /></span><br />');
$divAccessories.html($divAccessories.html() + '<div class="form-control-static"><button type="button" class="delAccessory btn btn-default" name="' + productId + '"><i class="icon-remove text-danger"></i></button>&nbsp;'+ productName +'</div>');
$nameAccessories.val($nameAccessories.val() + productName + '¤');
$inputAccessories.val($inputAccessories.val() + productId + '-');
$('#product_autocomplete_input').val('');
@@ -669,7 +669,7 @@ product_tabs['Associations'] = new function(){
{
input.value += inputCut[i] + '-';
name.value += nameCut[i] + '¤';
div.innerHTML += nameCut[i] + ' <span class="delAccessory" name="' + inputCut[i] + '" style="cursor: pointer;"><img src="../img/admin/delete.gif" /></span><br />';
div.innerHTML += '<div class="form-control-static"><button type="button" class="delAccessory btn btn-default" name="' + inputCut[i] +'"><i class="icon-remove text-danger"></i></button>&nbsp;' + nameCut[i] + '</div>';
}
else
$('#selectAccessories').append('<option selected="selected" value="' + inputCut[i] + '-' + nameCut[i] + '">' + inputCut[i] + ' - ' + nameCut[i] + '</option>');
@@ -825,13 +825,13 @@ product_tabs['Informations'] = new function(){
scroll:false,
cacheLength:0,
formatItem: function(item) {
return item[0]+' - '+item[1];
return item[0]+' - '+item[1];
}
}).result(function(e, i){
if(i != undefined)
addRelatedProduct(i[1], i[0]);
$(this).val('');
});
if(i != undefined)
addRelatedProduct(i[1], i[0]);
$(this).val('');
});
addRelatedProduct(id_product_redirected, product_name_redirected);
};
@@ -1046,7 +1046,7 @@ product_tabs['Pack'] = new function(){
var lineDisplay = curPackItemQty+ 'x ' +curPackItemName;
var divContent = $('#divPackItems').html();
divContent += '<li><button class="btn btn-default delPackItem" name="' + curPackItemId + '" ><i class="icon-trash"></i></button>'+
divContent += '<li><button class="btn btn-default delPackItem" name="' + curPackItemId + '" ><i class="icon-remove text-danger"></i></button>'+
lineDisplay+'</li>';
// QTYxID-QTYxID
@@ -1098,7 +1098,7 @@ product_tabs['Pack'] = new function(){
{
input.value += inputCut[i] + '-';
name.value += nameCut[i] + '¤';
div.innerHTML += nameCut[i] + '<li><button class="btn btn-default delPackItem" name="' + inputQty[1] + '"><i class="icon-trash"></i></button></li>';
div.innerHTML += nameCut[i] + '<li><button class="btn btn-default delPackItem" name="' + inputQty[1] + '"><i class="icon-remove text-danger"></i></button></li>';
}
}
+2 -4
View File
@@ -647,19 +647,17 @@ function addRelatedProduct(id_product_to_add, product_name)
if (!id_product_to_add || id_product == id_product_to_add)
return;
$('#related_product_name').html(product_name);
$('#related_product_name').parent('p').css('margin-top', 0);
$('input[name=id_product_redirected]').val(id_product_to_add);
$('#related_product_autocomplete_input').hide();
$('#related_product_autocomplete_input').parent().hide();
$('#related_product_remove').show();
}
function removeRelatedProduct()
{
$('#related_product_name').html(no_related_product);
$('#related_product_name').parent('p').css('margin-top', '0.5em');
$('input[name=id_product_redirected]').val(0);
$('#related_product_remove').hide();
$('#related_product_autocomplete_input').fadeIn();
$('#related_product_autocomplete_input').parent().fadeIn();
}
function showRedirectProductSelectOptions(show)