Commit 453c21a0 by Damien Moulard

fix loading on shelf admin add products

parent 9e0f8ad0
Pipeline #2269 passed with stage
in 1 minute 25 seconds
...@@ -15,7 +15,6 @@ var main_content = $('#main-content'), ...@@ -15,7 +15,6 @@ var main_content = $('#main-content'),
destroy_shelf_msg = $('#destroy-shelf-msg'), destroy_shelf_msg = $('#destroy-shelf-msg'),
adding_pdts_tpl = $('#adding-products').clone() adding_pdts_tpl = $('#adding-products').clone()
.removeAttr('id'), .removeAttr('id'),
add_products = $('.add-products'),
active_phase = 'main', active_phase = 'main',
add_to_shelf_product_ids = [], add_to_shelf_product_ids = [],
barcodes = null; barcodes = null;
...@@ -452,7 +451,8 @@ var recordProductsAddedShelf = function() { ...@@ -452,7 +451,8 @@ var recordProductsAddedShelf = function() {
}); });
if (is_time_to('add_pdts_to_shelf', 5000)) { // prevent double click or browser hic up bug if (is_time_to('add_pdts_to_shelf', 5000)) { // prevent double click or browser hic up bug
main_content.find('.add-products').html(loading_img); openModal(); // loading on
post_form( post_form(
'/shelfs/admin/add_products', '/shelfs/admin/add_products',
{bc: JSON.stringify(barcodes), shelf_id: id}, {bc: JSON.stringify(barcodes), shelf_id: id},
...@@ -468,6 +468,8 @@ var recordProductsAddedShelf = function() { ...@@ -468,6 +468,8 @@ var recordProductsAddedShelf = function() {
msg += "\n" + bc; msg += "\n" + bc;
}); });
} }
closeModal();
alert(msg); alert(msg);
backToMain(); backToMain();
} else { } else {
...@@ -476,7 +478,8 @@ var recordProductsAddedShelf = function() { ...@@ -476,7 +478,8 @@ var recordProductsAddedShelf = function() {
else if (typeof rData.res.msg != "undefined") else if (typeof rData.res.msg != "undefined")
msg = rData.res.msg; msg = rData.res.msg;
alert(msg); alert(msg);
main_content.find('.add-products').html(add_products); main_content.find('.add-products').show();
closeModal();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment