update action cable and other bugs

This commit is contained in:
Aung Myo
2018-05-21 13:00:55 +06:30
parent e722ab88e9
commit 7e8b69aa7c
26 changed files with 749 additions and 537 deletions

View File

@@ -3,7 +3,12 @@ App.order = App.cable.subscriptions.create('OrderChannel', {
disconnected: function() {},
received: function(data) {
received: function(data) {
var hostname = location.hostname.trim();
console.log(hostname)
console.log(data.from)
if(data.from == "" || hostname == data.from)
{
if (data.type == 'order') {
$('.table_'+data.table.id).removeClass('green');
$('.table_'+data.table.id).addClass('blue');
@@ -14,6 +19,7 @@ App.order = App.cable.subscriptions.create('OrderChannel', {
$('.new_text_'+data.table.id).html('');
$('.new_text_'+data.table.id).removeClass('hide')
}
}
}
});