update conflict js

This commit is contained in:
Aung Myo
2018-05-21 13:04:00 +06:30
26 changed files with 701 additions and 493 deletions

View File

@@ -3,21 +3,23 @@ App.check_new_order = App.cable.subscriptions.create('CheckNewOrderChannel', {
disconnected: function() {},
received: function(data) {
var order = data.data;
var shop_code = data.shop_code;
if(order.length > 0){
var order_lists = "";
$.each(order, function(key, value){
if(key==0){
order_lists = value.order_reservation_id;
}else if(key == (order.length - 1)){
order_lists += ' and ' + value.order_reservation_id;
}else{
order_lists += ', ' + value.order_reservation_id;
}
});
received: function(data) {
var hostname = location.hostname.trim();
if(data.from == "" || hostname == data.from)
{
var order = data.data;
var shop_code = data.shop_code;
if(order.length > 0){
var order_lists = "";
$.each(order, function(key, value){
if(key==0){
order_lists = value.order_reservation_id;
}else if(key == (order.length - 1)){
order_lists += ' and ' + value.order_reservation_id;
}else{
order_lists += ', ' + value.order_reservation_id;
}
});
// alert(order_lists);
if (typeof checkNewOrderAlert !== 'undefined' && $.isFunction(checkNewOrderAlert)) {
checkNewOrderAlert(shop_code, order_lists);