change popup ui

This commit is contained in:
phyusin
2018-05-14 15:42:11 +06:30
parent cc0178eb65
commit 1c8ea30efa
6 changed files with 128 additions and 127 deletions

View File

@@ -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 <br/>"+
"Are you accept or reject for these orders <b>"+order_lists+"</b>?",
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");
// swal({
// title: 'Information',
// target: document.getElementById(shop_code+"_notify_new_order"),
// text: "You have new orders <br/>"+
// "Are you accept or reject for these orders <b>"+order_lists+"</b>?",
// type: 'success',
// html: true,
// closeOnConfirm: false,
// closeOnCancel: false,
// allowOutsideClick: false
// }, function (isConfirm) {
// if(isConfirm){
// swal.close();
// }
// $("#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_lists").text(order_lists);
// if($("#notify_new_order").hasClass("hidden")){
$("#notify_new_order").removeClass("hidden");
// }
$("#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});
}
}
});

View File

@@ -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 <br/>"+
"Could you ready these orders <b>"+order_lists+"</b> 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");
// swal({
// title: 'Information',
// target: document.getElementById(shop_code+"_notify_order_ready_to_delivery"),
// text: "You have orders that are ready to deliver <br/>"+
// "Could you ready these orders <b>"+order_lists+"</b> to deliver?",
// type: 'success',
// html: true,
// closeOnConfirm: false,
// closeOnCancel: false,
// allowOutsideClick: false
// }, function (isConfirm) {
// if(isConfirm){
// swal.close();
// }
// $("#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_lists").text(order_lists);
// if($("#notify_order_ready_to_delivery").hasClass("hidden")){
$("#notify_order_ready_to_delivery").removeClass("hidden");
// }
$("#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});
}
}
});

View File

@@ -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 <br/>"+
"Could you send these orders <b>"+order_lists+"</b> 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");
// swal({
// title: 'Information',
// target: document.getElementById(shop_code+"_notify_order_send_to_kitchen"),
// text: "You have to send order to kitchen <br/>"+
// "Could you send these orders <b>"+order_lists+"</b> to kitchen?",
// type: 'success',
// html: true,
// closeOnConfirm: false,
// closeOnCancel: false,
// allowOutsideClick: false
// }, function (isConfirm) {
// if(isConfirm){
// swal.close();
// }
// $("#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_lists").text(order_lists);
// if($("#notify_order_send_to_kitchen").hasClass("hidden")){
$("#notify_order_send_to_kitchen").removeClass("hidden");
// }
$("#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});
}
}
});

View File

@@ -157,12 +157,10 @@ $(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');
@@ -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 "+
"<b>"+order_reservation.order_reservation_id+"</b> 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 "+
// "<b>"+order_reservation.order_reservation_id+"</b> requested for "+requested_date+"?",
// type: 'success',
// html: true,
// closeOnConfirm: false,
// closeOnCancel: false,
// allowOutsideClick: false
// }, function (isConfirm) {
// if(isConfirm){
// audio.pause();
// swal.close();
// }
// });
}
}

View File

@@ -464,10 +464,10 @@
</div>
</div>
<div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_doemal_new_order"></div>
<!-- <div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_doemal_new_order"></div>
<div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_new_order"></div>
<div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_order_send_to_kitchen"></div>
<div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_order_ready_to_delivery"></div>
<div id="<%= @shop.shop_code ? @shop.shop_code : '' %>_notify_order_ready_to_delivery"></div> -->
</div>
<p id="ref_no" class="hidden"></p>
@@ -584,7 +584,7 @@
</div>
</div>
<!-- <div class="modal fade text-center" id="<%= @shop.shop_code ? @shop.shop_code : '' %>_doemal_new_order" tabindex="-1" role="dialog">
<div class="modal fade text-center" id="<%= @shop.shop_code ? @shop.shop_code : '' %>_doemal_new_order" tabindex="-1" role="dialog">
<div class="modal-dialog modal-md" role="document">
<div class="modal-content">
<div class="modal-header">
@@ -598,7 +598,7 @@
<div class="modal-footer ">
<div class="row p-r-20">
<div class="col-md-5">
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect new_order_close" data-value="<%= @shop.shop_code ? @shop.shop_code : '' %>" data-dismiss="modal">CLOSE</button>
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue new_order_close" data-value="<%= @shop.shop_code ? @shop.shop_code : '' %>"data-dismiss="modal">CLOSE</button>
</div>
</div>
</div>
@@ -620,7 +620,7 @@
<div class="modal-footer ">
<div class="row p-r-20">
<div class="col-md-5">
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue" data-dismiss="modal">CLOSE</button>
</div>
</div>
</div>
@@ -642,7 +642,7 @@
<div class="modal-footer ">
<div class="row p-r-20">
<div class="col-md-5">
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue" data-dismiss="modal">CLOSE</button>
</div>
</div>
</div>
@@ -664,11 +664,11 @@
<div class="modal-footer ">
<div class="row p-r-20">
<div class="col-md-5">
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue" data-dismiss="modal">CLOSE</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div> -->