From 9fe77bb283e867a9a3108f7b932439988f696a05 Mon Sep 17 00:00:00 2001 From: phyusin Date: Thu, 10 May 2018 15:50:46 +0630 Subject: [PATCH] chagne notification modal --- .../javascripts/channels/check_new_order.js | 40 ++++++++++------- .../channels/check_order_ready_to_delivery.js | 40 ++++++++++------- .../channels/check_order_send_to_kitchen.js | 40 ++++++++++------- app/assets/javascripts/order_reservation.js | 2 +- .../origami/order_reservation/index.html.erb | 44 +++++++++---------- 5 files changed, 92 insertions(+), 74 deletions(-) diff --git a/app/assets/javascripts/channels/check_new_order.js b/app/assets/javascripts/channels/check_new_order.js index 403874e9..a51327c3 100644 --- a/app/assets/javascripts/channels/check_new_order.js +++ b/app/assets/javascripts/channels/check_new_order.js @@ -18,23 +18,29 @@ App.check_new_order = App.cable.subscriptions.create('CheckNewOrderChannel', { }); // alert(order_lists); - swal({ - title: 'Information', - target: document.getElementById("notify_new_order"), - text: "You have new orders
"+ - "Are you accept or reject for these orders "+order_lists+"?", - type: 'success', - html: true, - closeOnConfirm: false, - closeOnCancel: false, - allowOutsideClick: false - }, function (isConfirm) { - if(isConfirm){ - swal.close(); - } - }); - // $("#notify_new_order_lists").text(order_lists); - // $("#notify_new_order").modal({show: true, keyboard: false, backdrop: false}); + // swal({ + // title: 'Information', + // target: document.getElementById("notify_new_order"), + // text: "You have new orders
"+ + // "Are you accept or reject for these orders "+order_lists+"?", + // type: 'success', + // html: true, + // closeOnConfirm: false, + // closeOnCancel: false, + // allowOutsideClick: false + // }, function (isConfirm) { + // if(isConfirm){ + // swal.close(); + // } + // }); + $("#notify_new_order_lists").text(order_lists); + $("#notify_new_order").on('shown.bs.modal', function(e){ + $("#notify_new_order").focus(); + $("#notify_order_send_to_kitchen").modal('hide'); + $("#notify_order_ready_to_delivery").modal('hide'); + }).on('hide.bs.modal', function (e) { + $("#notify_new_order").modal("hide"); + }).modal({show: true, keyboard: false, backdrop: false}); } } }); diff --git a/app/assets/javascripts/channels/check_order_ready_to_delivery.js b/app/assets/javascripts/channels/check_order_ready_to_delivery.js index 4627dede..97e2a266 100644 --- a/app/assets/javascripts/channels/check_order_ready_to_delivery.js +++ b/app/assets/javascripts/channels/check_order_ready_to_delivery.js @@ -18,23 +18,29 @@ App.check_order_ready_to_delivery = App.cable.subscriptions.create('CheckOrderRe }); // alert(order_lists); - swal({ - title: 'Information', - target: document.getElementById("notify_order_ready_to_delivery"), - text: "You have orders that are ready to deliver
"+ - "Could you ready these orders "+order_lists+" to deliver?", - type: 'success', - html: true, - closeOnConfirm: false, - closeOnCancel: false, - allowOutsideClick: false - }, function (isConfirm) { - if(isConfirm){ - swal.close(); - } - }); - // $("#notify_order_ready_to_delivery_lists").text(order_lists); - // $("#notify_order_ready_to_delivery").modal({show: true, keyboard: false, backdrop: false}); + // swal({ + // title: 'Information', + // target: document.getElementById("notify_order_ready_to_delivery"), + // text: "You have orders that are ready to deliver
"+ + // "Could you ready these orders "+order_lists+" to deliver?", + // type: 'success', + // html: true, + // closeOnConfirm: false, + // closeOnCancel: false, + // allowOutsideClick: false + // }, function (isConfirm) { + // if(isConfirm){ + // swal.close(); + // } + // }); + $("#notify_order_ready_to_delivery_lists").text(order_lists); + $("#notify_order_ready_to_delivery").on('shown.bs.modal', function(e){ + $("#notify_order_ready_to_delivery").focus(); + $("#notify_new_order").modal('hide'); + $("#notify_order_send_to_kitchen").modal('hide'); + }).on('hide.bs.modal', function (e) { + $("#notify_order_ready_to_delivery").modal("hide"); + }).modal({show: true, keyboard: false, backdrop: false}); } } }); diff --git a/app/assets/javascripts/channels/check_order_send_to_kitchen.js b/app/assets/javascripts/channels/check_order_send_to_kitchen.js index 31c6b75c..f3a15903 100644 --- a/app/assets/javascripts/channels/check_order_send_to_kitchen.js +++ b/app/assets/javascripts/channels/check_order_send_to_kitchen.js @@ -18,23 +18,29 @@ App.check_order_send_to_kitchen = App.cable.subscriptions.create('CheckOrderSend }); // alert(order_lists); - swal({ - title: 'Information', - target: document.getElementById("notify_order_send_to_kitchen"), - text: "You have to send order to kitchen
"+ - "Could you send these orders "+order_lists+" to kitchen?", - type: 'success', - html: true, - closeOnConfirm: false, - closeOnCancel: false, - allowOutsideClick: false - }, function (isConfirm) { - if(isConfirm){ - swal.close(); - } - }); - // $("#notify_order_send_to_kitchen_lists").text(order_lists); - // $("#notify_order_send_to_kitchen").modal({show: true, keyboard: false, backdrop: false}); + // swal({ + // title: 'Information', + // target: document.getElementById("notify_order_send_to_kitchen"), + // text: "You have to send order to kitchen
"+ + // "Could you send these orders "+order_lists+" to kitchen?", + // type: 'success', + // html: true, + // closeOnConfirm: false, + // closeOnCancel: false, + // allowOutsideClick: false + // }, function (isConfirm) { + // if(isConfirm){ + // swal.close(); + // } + // }); + $("#notify_order_send_to_kitchen_lists").text(order_lists); + $("#notify_order_send_to_kitchen").on('shown.bs.modal', function(e){ + $("#notify_order_send_to_kitchen").focus(); + $("#notify_new_order").modal('hide'); + $("#notify_order_ready_to_delivery").modal('hide'); + }).on('hide.bs.modal', function (e) { + $("#notify_order_send_to_kitchen").modal("hide"); + }).modal({show: true, keyboard: false, backdrop: false}); } } }); diff --git a/app/assets/javascripts/order_reservation.js b/app/assets/javascripts/order_reservation.js index d17250ae..8f631284 100644 --- a/app/assets/javascripts/order_reservation.js +++ b/app/assets/javascripts/order_reservation.js @@ -45,7 +45,7 @@ $(function() { $("#accepted").on("click", function(){ if($(this).text().trim() == "ACCEPT"){ $("#status").text($(this).attr("data-value")); - var requested_time = $("#requested_date_time").text(); + var requested_time = $("#requested_time").text(); $("#requested_order_time").text(requested_time); $("#waiting_timeModal").modal({show : true, backdrop: false, keyboard : false}); }else{ diff --git a/app/views/origami/order_reservation/index.html.erb b/app/views/origami/order_reservation/index.html.erb index 45c7bf82..9a958dde 100644 --- a/app/views/origami/order_reservation/index.html.erb +++ b/app/views/origami/order_reservation/index.html.erb @@ -31,33 +31,33 @@
-
+
@@ -384,8 +384,8 @@ -
-
+
+
@@ -452,9 +452,9 @@ -
+ @@ -571,11 +571,11 @@ - +