From c65bf1c1638e1348c1a2c789b8d8486032f2f721 Mon Sep 17 00:00:00 2001 From: phyusin Date: Fri, 11 May 2018 17:14:42 +0630 Subject: [PATCH] check shop code in order reservation --- app/assets/javascripts/channels/order_reservation.js | 4 ++-- app/assets/javascripts/order_reservation.js | 8 ++++---- app/views/origami/order_reservation/index.html.erb | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/channels/order_reservation.js b/app/assets/javascripts/channels/order_reservation.js index b0e0c272..32265e38 100644 --- a/app/assets/javascripts/channels/order_reservation.js +++ b/app/assets/javascripts/channels/order_reservation.js @@ -8,12 +8,12 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel' var order = data.data; if(order.length > 0){ $('.custom-table.'+shop_code+'_order_reserve_cable tbody').html(""); - $(".nav-item.red > a > p.num").text(order.length); + $(".nav-item ."+shop_code+" .red > a > p.num").text(order.length); $.each(order, function(key,value){ var active_class = ""; if(key==0){ active_class = "tr-active"; - showNewOrder(order[key]); + showNewOrder(order[key],shop_code); } var rowCount = key+1; var date = new Date(value.created_at); diff --git a/app/assets/javascripts/order_reservation.js b/app/assets/javascripts/order_reservation.js index 9b7c8a06..3f5a0ddf 100644 --- a/app/assets/javascripts/order_reservation.js +++ b/app/assets/javascripts/order_reservation.js @@ -404,7 +404,7 @@ function timeFormat(date){ return time; } -function showNewOrder(order_reservation){ +function showNewOrder(order_reservation,shop_code){ if((order_reservation!=undefined) && (order_reservation!=null) && (order_reservation!="")){ var date = new Date(order_reservation.requested_time); var time = timeFormat(date); @@ -418,15 +418,15 @@ function showNewOrder(order_reservation){ $("#new_order").text(order_reservation.order_reservation_id); $("#new_order_date").text(requested_date); - $("#doemal_new_order").on('show.bs.modal', function(e){ + $("#"+shop_code+"_doemal_new_order").on('show.bs.modal', function(e){ $("#notify_new_order").modal('hide'); $("#notify_order_send_to_kitchen").modal('hide'); $("#notify_order_ready_to_delivery").modal('hide'); }).on('shown.bs.modal', function(e){ - $("#doemal_new_order").focus(); + $("#"+shop_code+"_doemal_new_order").focus(); }).on('hide.bs.modal', function (e) { audio.pause(); - $("#doemal_new_order").modal("hide"); + $("#"+shop_code+"_doemal_new_order").modal("hide"); }).modal({show: true, keyboard: false, backdrop: false}); } } diff --git a/app/views/origami/order_reservation/index.html.erb b/app/views/origami/order_reservation/index.html.erb index aa85fe71..6bd8344b 100644 --- a/app/views/origami/order_reservation/index.html.erb +++ b/app/views/origami/order_reservation/index.html.erb @@ -31,7 +31,7 @@
-