update call waiter

This commit is contained in:
Aung Myo
2017-12-04 19:23:37 +06:30
parent 0c0ba0858a
commit 3354733e41
10 changed files with 123 additions and 1 deletions

View File

@@ -0,0 +1,61 @@
App.call_waiter = App.cable.subscriptions.create('CallWaiterChannel', {
// App.messages = App.cable.subscriptions.create('MessagesChannel', {
connected: function() {},
disconnected: function() {},
received: function(data) {
console.log(data.table);
console.log(data.time);
table = data.table
// for Notificaiotn message
var placementFrom = "top";
var placementAlign = "center";
var animateEnter = "";
var animateExit = "";
var colorName = "alert-warning";
var text = " Calling Waiter <br> "+table.name ;
if (text != null || colorName != null){
showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit);
}
function showNotification(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
},
{
type: colorName,
newest_on_top: true,
allow_dismiss: allowDismiss,
newest_on_top: true,
timer: 200000000000000,
placement: {
from: placementFrom,
align: placementAlign
},
animate: {
enter: animateEnter,
exit: animateExit
},
template: '<div data-notify="container" style="max-width: 180px !important;" class="bootstrap-notify-container alert alert-dismissible {0} ' + (allowDismiss ? "p-r-30" : "") + '" role="alert">' +
'<button type="button" aria-hidden="true" class="close float-right m-l-20 m-t--5" data-notify="dismiss" style="right: -5px;">×</button>' +
'<span data-notify="icon"></span> ' +
'<span data-notify="title">{1}</span> ' +
'<span data-notify="message">{2}</span>' +
'<div class="progress" data-notify="progressbar">' +
'<div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' +
'</div>' +
'<a href="{3}" target="{4}" data-notify="url"></a>' +
'</div>'
});
}
//end Notificaiotn message
}
});