update call waiter channel

This commit is contained in:
Aung Myo
2017-12-05 10:24:01 +06:30
parent 3354733e41
commit 20a86b86f5
2 changed files with 39 additions and 41 deletions

View File

@@ -6,56 +6,54 @@ App.call_waiter = App.cable.subscriptions.create('CallWaiterChannel', {
disconnected: function() {}, disconnected: function() {},
received: function(data) { received: function(data) {
console.log(data.table); table = data.table
console.log(data.time);
table = data.table
// for Notificaiotn message // for Notificaiotn message
var placementFrom = "top"; var placementFrom = "top";
var placementAlign = "center"; var placementAlign = "center";
var animateEnter = ""; var animateEnter = "";
var animateExit = ""; var animateExit = "";
var colorName = "alert-warning"; var colorName = "alert-warning";
var text = " Calling Waiter <br> "+table.name ; var text = " Calling Waiter <br> "+table.name ;
if (text != null || colorName != null){ if (text != null || colorName != null){
showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit); showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit);
} }
function showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit) { function showNotification(colorName, text, placementFrom, placementAlign, animateEnter, animateExit) {
if (colorName === null || colorName === '') { colorName = 'bg-black'; } if (colorName === null || colorName === '') { colorName = 'bg-black'; }
if (animateEnter === null || animateEnter === '') { animateEnter = 'animated fadeInDown'; } if (animateEnter === null || animateEnter === '') { animateEnter = 'animated fadeInDown'; }
if (animateExit === null || animateExit === '') { animateExit = 'animated fadeOutUp'; } if (animateExit === null || animateExit === '') { animateExit = 'animated fadeOutUp'; }
var allowDismiss = true; var allowDismiss = true;
$.notify({ $.notify({
message: text message: text
}, },
{ {
type: colorName, type: colorName,
newest_on_top: true, allow_dismiss: allowDismiss,
allow_dismiss: allowDismiss, newest_on_top: true,
newest_on_top: true, timer: 200000000000000,
timer: 200000000000000, placement: {
placement: { from: placementFrom,
from: placementFrom, align: placementAlign
align: placementAlign },
}, animate: {
animate: { enter: animateEnter,
enter: animateEnter, exit: animateExit
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">' +
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>' +
'<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="icon"></span> ' + '<span data-notify="title">{1}</span> ' +
'<span data-notify="title">{1}</span> ' + '<span data-notify="message">{2}</span>' +
'<span data-notify="message">{2}</span>' + '<div class="progress" data-notify="progressbar">' +
'<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 class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' + '</div>' +
'</div>' + '<a href="{3}" target="{4}" data-notify="url"></a>' +
'<a href="{3}" target="{4}" data-notify="url"></a>' + '</div>'
'</div>' });
}); }
}
//end Notificaiotn message //end Notificaiotn message
} }
}); });

View File

@@ -380,7 +380,7 @@
}); });
$('#pay').click(function() { $('#pay').click(function() {
$('#pay').text("Processing, Please wait!") // $('#pay').text("Processing, Please wait!")
$( "#loading_wrapper" ).show(); $( "#loading_wrapper" ).show();