From 1c8ea30efaf9a661f99c1f35c7f9772a0b6f8db4 Mon Sep 17 00:00:00 2001 From: phyusin Date: Mon, 14 May 2018 15:42:11 +0630 Subject: [PATCH] change popup ui --- .../javascripts/channels/check_new_order.js | 51 ++++++----- .../channels/check_order_ready_to_delivery.js | 51 ++++++----- .../channels/check_order_send_to_kitchen.js | 51 ++++++----- app/assets/javascripts/order_reservation.js | 86 +++++++++--------- .../origami/order_reservation/index.html.erb | 16 ++-- public/{beep.mp3 => AC-beep.mp3} | Bin 6 files changed, 128 insertions(+), 127 deletions(-) rename public/{beep.mp3 => AC-beep.mp3} (100%) diff --git a/app/assets/javascripts/channels/check_new_order.js b/app/assets/javascripts/channels/check_new_order.js index a6317af6..92e0e715 100644 --- a/app/assets/javascripts/channels/check_new_order.js +++ b/app/assets/javascripts/channels/check_new_order.js @@ -19,33 +19,34 @@ App.check_new_order = App.cable.subscriptions.create('CheckNewOrderChannel', { }); // alert(order_lists); - swal({ - title: 'Information', - target: document.getElementById(shop_code+"_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); + // swal({ + // title: 'Information', + // target: document.getElementById(shop_code+"_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); // if($("#notify_new_order").hasClass("hidden")){ - // $("#notify_new_order").removeClass("hidden"); + $("#notify_new_order").removeClass("hidden"); // } - // $("#notify_new_order").on('show.bs.modal', function(e){ - // $("#notify_order_send_to_kitchen").addClass("hidden"); - // $("#notify_order_ready_to_delivery").addClass("hidden"); - // }).on('shown.bs.modal', function(e){ - // $("#notify_new_order").focus(); - // }).on('hide.bs.modal', function (e) { - // $("#notify_new_order").addClass("hidden"); - // }).modal({show: true, keyboard: false, backdrop: false}); + $("#notify_new_order").on('shown.bs.modal', function(e){ + $(document).off('focusin.modal'); + $("#notify_new_order").focus(); + $("#"+shop_code+"_doemal_new_order").addClass("hidden"); + $("#notify_order_send_to_kitchen").addClass("hidden"); + $("#notify_order_ready_to_delivery").addClass("hidden"); + }).on('hide.bs.modal', function (e) { + $("#notify_new_order").addClass("hidden"); + }).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 319f7781..05a257b3 100644 --- a/app/assets/javascripts/channels/check_order_ready_to_delivery.js +++ b/app/assets/javascripts/channels/check_order_ready_to_delivery.js @@ -19,33 +19,34 @@ App.check_order_ready_to_delivery = App.cable.subscriptions.create('CheckOrderRe }); // alert(order_lists); - swal({ - title: 'Information', - target: document.getElementById(shop_code+"_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); + // swal({ + // title: 'Information', + // target: document.getElementById(shop_code+"_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); // if($("#notify_order_ready_to_delivery").hasClass("hidden")){ - // $("#notify_order_ready_to_delivery").removeClass("hidden"); + $("#notify_order_ready_to_delivery").removeClass("hidden"); // } - // $("#notify_order_ready_to_delivery").on('shown.bs.modal', function(e){ - // $("#notify_new_order").addClass("hidden"); - // $("#notify_order_send_to_kitchen").addClass("hidden"); - // }).on('shown.bs.modal', function(e){ - // $("#notify_order_ready_to_delivery").focus(); - // }).on('hide.bs.modal', function (e) { - // $("#notify_order_ready_to_delivery").addClass("hidden"); - // }).modal({show: true, keyboard: false, backdrop: false}); + $("#notify_order_ready_to_delivery").on('shown.bs.modal', function(e){ + // $(document).off('focusin.modal'); + $("#notify_order_ready_to_delivery").focus(); + $("#"+shop_code+"_doemal_new_order").addClass("hidden"); + $("#notify_new_order").addClass("hidden"); + $("#notify_order_send_to_kitchen").addClass("hidden"); + }).on('hide.bs.modal', function (e) { + $("#notify_order_ready_to_delivery").addClass("hidden"); + }).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 df9eb324..f9432810 100644 --- a/app/assets/javascripts/channels/check_order_send_to_kitchen.js +++ b/app/assets/javascripts/channels/check_order_send_to_kitchen.js @@ -19,33 +19,34 @@ App.check_order_send_to_kitchen = App.cable.subscriptions.create('CheckOrderSend }); // alert(order_lists); - swal({ - title: 'Information', - target: document.getElementById(shop_code+"_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); + // swal({ + // title: 'Information', + // target: document.getElementById(shop_code+"_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); // if($("#notify_order_send_to_kitchen").hasClass("hidden")){ - // $("#notify_order_send_to_kitchen").removeClass("hidden"); + $("#notify_order_send_to_kitchen").removeClass("hidden"); // } - // $("#notify_order_send_to_kitchen").on('show.bs.modal', function(e){ - // $("#notify_new_order").addClass("hidden"); - // $("#notify_order_ready_to_delivery").addClass("hidden"); - // }).on('shown.bs.modal', function(e){ - // $("#notify_order_send_to_kitchen").focus(); - // }).on('hide.bs.modal', function (e) { - // $("#notify_order_send_to_kitchen").addClass("hidden"); - // }).modal({show: true, keyboard: false, backdrop: false}); + $("#notify_order_send_to_kitchen").on('shown.bs.modal', function(e){ + // $(document).off('focusin.modal'); + $("#notify_order_send_to_kitchen").focus(); + $("#"+shop_code+"_doemal_new_order").addClass("hidden"); + $("#notify_new_order").addClass("hidden"); + $("#notify_order_ready_to_delivery").addClass("hidden"); + }).on('hide.bs.modal', function (e) { + $("#notify_order_send_to_kitchen").addClass("hidden"); + }).modal({show: true, keyboard: false, backdrop: false}); } } }); diff --git a/app/assets/javascripts/order_reservation.js b/app/assets/javascripts/order_reservation.js index 83618770..c2219381 100644 --- a/app/assets/javascripts/order_reservation.js +++ b/app/assets/javascripts/order_reservation.js @@ -157,24 +157,22 @@ $(function() { } }); - // $('button[data-dismiss="modal"]').on('click', function(){ $(this).parent().parent().parent().parent().modal('hide'); }); - - // $(".new_order_close").on("click",function(){ - // var code = $(this).attr("data-value"); - // $("#"+code+"_doemal_new_order").modal("hide"); - // }); + $('button[data-dismiss="modal"]').on('click', function(){ + alert("hi"); + // $(this).parent().parent().parent().parent().parent().parent().modal('hide'); + }); // $("[data-dismiss='modal']").on('click', function() { - // $('body').addClass('modal-open-fix'); - // if($('body').css("padding-right") == '15px') { - // $('body').addClass('modal-open-fix-pad'); - // } - // setTimeout(function() { - // if($('body').hasClass('modal-open-fix-pad')) { - // $('body').css('padding-right', '15px'); - // } - // $('body').addClass('modal-open').removeClass('modal-open-fix, modal-open-fix-pad'); - // }, 1000); + // $('body').addClass('modal-open-fix'); + // if($('body').css("padding-right") == '15px') { + // $('body').addClass('modal-open-fix-pad'); + // } + // setTimeout(function() { + // if($('body').hasClass('modal-open-fix-pad')) { + // $('body').css('padding-right', '15px'); + // } + // $('body').addClass('modal-open').removeClass('modal-open-fix, modal-open-fix-pad'); + // }, 1000); // }); }); @@ -473,36 +471,36 @@ function showNewOrder(order_reservation,shop_code){ audio.play(); // },10000); - // $("#new_order").text(order_reservation.order_reservation_id); - // $("#new_order_date").text(requested_date); + $("#new_order").text(order_reservation.order_reservation_id); + $("#new_order_date").text(requested_date); // if($("#"+shop_code+"_doemal_new_order").hasClass("hidden")){ - // $("#"+shop_code+"_doemal_new_order").removeClass("hidden"); + $("#"+shop_code+"_doemal_new_order").removeClass("hidden"); // } - // $("#"+shop_code+"_doemal_new_order").on('show.bs.modal', function(e){ - // $("#notify_new_order").addClass("hidden"); - // $("#notify_order_send_to_kitchen").addClass("hidden"); - // $("#notify_order_ready_to_delivery").addClass("hidden"); - // }).on('shown.bs.modal', function(e){ - // $("#"+shop_code+"_doemal_new_order").focus(); - // }).on('hide.bs.modal', function (e) { - // $("#"+shop_code+"_doemal_new_order").addClass("hidden"); - // }).modal({show: true, keyboard: false, backdrop: false}); - swal({ - title: 'Information', - target: document.getElementById(shop_code+"_notify_new_order"), - text: "You have new order "+ - ""+order_reservation.order_reservation_id+" requested for "+requested_date+"?", - type: 'success', - html: true, - closeOnConfirm: false, - closeOnCancel: false, - allowOutsideClick: false - }, function (isConfirm) { - if(isConfirm){ - audio.pause(); - swal.close(); - } - }); + $("#"+shop_code+"_doemal_new_order").on('shown.bs.modal', function(e){ + // $(document).off('focusin.modal'); + $("#"+shop_code+"_doemal_new_order").focus(); + $("#notify_new_order").addClass("hidden"); + $("#notify_order_send_to_kitchen").addClass("hidden"); + $("#notify_order_ready_to_delivery").addClass("hidden"); + }).on('hide.bs.modal', function (e) { + $("#"+shop_code+"_doemal_new_order").addClass("hidden"); + }).modal({show: true, keyboard: false, backdrop: false}); + // swal({ + // title: 'Information', + // target: document.getElementById(shop_code+"_notify_new_order"), + // text: "You have new order "+ + // ""+order_reservation.order_reservation_id+" requested for "+requested_date+"?", + // type: 'success', + // html: true, + // closeOnConfirm: false, + // closeOnCancel: false, + // allowOutsideClick: false + // }, function (isConfirm) { + // if(isConfirm){ + // audio.pause(); + // swal.close(); + // } + // }); } } diff --git a/app/views/origami/order_reservation/index.html.erb b/app/views/origami/order_reservation/index.html.erb index d2903041..94a6cfc6 100644 --- a/app/views/origami/order_reservation/index.html.erb +++ b/app/views/origami/order_reservation/index.html.erb @@ -464,10 +464,10 @@ -
+ @@ -584,7 +584,7 @@ - + diff --git a/public/beep.mp3 b/public/AC-beep.mp3 similarity index 100% rename from public/beep.mp3 rename to public/AC-beep.mp3