App.call_waiter = App.cable.subscriptions.create('CallWaiterChannel', {
// App.messages = App.cable.subscriptions.create('MessagesChannel', {
connected: function() {},
disconnected: function() {},
received: function(data) {
table = data.table
// for Notificaiotn message
var element = "#notify-wrapper"
var placementFrom = "top";
var placementAlign = "center";
var animateEnter = "";
var animateExit = "";
var colorName = "alert-warning";
var text = " Calling Waiter
"+table.name ;
if (text != null || colorName != null){
showNotification(element, colorName, text, placementFrom, placementAlign, animateEnter, animateExit);
}
function showNotification(element, colorName, text, placementFrom, placementAlign, animateEnter, animateExit) {
if (colorName === null || colorName === '') { colorName = 'bg-black'; }
if (animateEnter === null || animateEnter === '') { animateEnter = 'animated fadeInDown'; }
if (animateExit === null || animateExit === '') { animateExit = 'animated fadeOutUp'; }
var allowDismiss = true;
$.notify({
message: text
},
{
element: element,
type: colorName,
allow_dismiss: allowDismiss,
timer: 200000000000000,
placement: {
from: placementFrom,
align: placementAlign
},
animate: {
enter: animateEnter,
exit: animateExit
},
template: '