diff --git a/js/admin/orders.js b/js/admin/orders.js index 607c659ff..e9d05ad2f 100644 --- a/js/admin/orders.js +++ b/js/admin/orders.js @@ -758,33 +758,25 @@ function initRoomEvents() success : function(data) { if (data.result) { - if (data.refresh) - { - window.location.href = admin_order_tab_link + '&conf=3&vieworder&id_order=' + id_order; - return; - } - go = false; + window.location.href = admin_order_tab_link + '&conf=3&vieworder&id_order=' + id_order; //commented by webkul /*updateAmounts(data.order); updateInvoice(data.invoices); updateDocuments(data.documents_html); updateShipping(data.shipping_html);*/ - // Initialize all events - init(); - window.location.href = admin_order_tab_link + '&conf=3&vieworder&id_order=' + id_order; //End // $('.partial_refund_fields').hide(); - } - else - jAlert(data.error); + } else { + jAlert(data.error); + $('.submitAddRoom').removeAttr('disabled'); + $('#submitAddRoom').removeAttr('disabled'); + } }, error : function(XMLHttpRequest, textStatus, errorThrown) { jAlert("Impossible to add the room to the cart.\n\ntextStatus: '" + textStatus + "'\nerrorThrown: '" + errorThrown + "'\nresponseText:\n" + XMLHttpRequest.responseText); }, complete: function() { - $('.submitAddRoom').removeAttr('disabled'); - $('#submitAddRoom').removeAttr('disabled'); $(".loading_overlay").hide(); } }); diff --git a/js/admin/reallocation.js b/js/admin/reallocation.js index 130e03c7c..7c7baf1aa 100644 --- a/js/admin/reallocation.js +++ b/js/admin/reallocation.js @@ -31,13 +31,17 @@ $(document).ready(function() { /*For reallocating rooms in the modal*/ $(document).on('click', '#realloc_allocated_rooms', function(e){ + $(".loading_overlay").show(); if (RoomReallocationModal.reallocate() == false) { + $(".loading_overlay").hide(); return false; } }); /*For swaping rooms in the modal*/ $(document).on('click', '#swap_allocated_rooms', function(){ + $(".loading_overlay").show(); if (RoomReallocationModal.swap() == false) { + $(".loading_overlay").hide(); return false; } });