ac test
This commit is contained in:
@@ -8,13 +8,7 @@
|
||||
// Temp Disable
|
||||
(function() {
|
||||
this.App || (this.App = {});
|
||||
|
||||
// var hostname = location.hostname;
|
||||
// var port = location.port;
|
||||
// var host = hostname + ":" + port + "/cable"
|
||||
// console.log(host);
|
||||
// App.cable = ActionCable.createConsumer();
|
||||
// console.log(App.cable);
|
||||
|
||||
App.cable = ActionCable.createConsumer();
|
||||
|
||||
}).call(this);
|
||||
|
||||
@@ -6,15 +6,20 @@ App.order = App.cable.subscriptions.create('BillChannel', {
|
||||
disconnected: function() {},
|
||||
|
||||
received: function(data) {
|
||||
if($('.table_'+data.table.id).hasClass('blue')){
|
||||
$('.table_'+data.table.id).removeClass('blue');
|
||||
$('.table_'+data.table.id).addClass('red');
|
||||
}else{
|
||||
$('.table_'+data.table.id).removeClass('orange');
|
||||
$('.table_'+data.table.id).addClass('red');
|
||||
}
|
||||
$('.new_text_'+data.table.id).removeClass('hide');
|
||||
$('.new_text_'+data.table.id).text('billed');
|
||||
var hostname = location.hostname;
|
||||
console.log(hostname + "\n" + data.from);
|
||||
if(data.from == "" || hostname == data.from)
|
||||
{
|
||||
if($('.table_'+data.table.id).hasClass('blue')){
|
||||
$('.table_'+data.table.id).removeClass('blue');
|
||||
$('.table_'+data.table.id).addClass('red');
|
||||
}else{
|
||||
$('.table_'+data.table.id).removeClass('orange');
|
||||
$('.table_'+data.table.id).addClass('red');
|
||||
}
|
||||
$('.new_text_'+data.table.id).removeClass('hide');
|
||||
$('.new_text_'+data.table.id).text('billed');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user