auto reload page for oqs 5sec and origami 10sec

This commit is contained in:
Yan
2017-06-14 15:59:08 +06:30
parent c1e8f3ffb2
commit 7d6414cce6
3 changed files with 19 additions and 5 deletions

View File

@@ -17,6 +17,11 @@
//= require cable //= require cable
$(document).ready(function(){ $(document).ready(function(){
// auto refresh every 5 seconds
setTimeout(function(){
window.location.reload(1);
}, 5000);
$('.queue_station').on('click',function(){ $('.queue_station').on('click',function(){
var orderZone=$(this).children().children().children('.order-zone').text(); var orderZone=$(this).children().children().children('.order-zone').text();
var orderItem=$(this).children().children().children('.order-item').text(); var orderItem=$(this).children().children().children('.order-item').text();
@@ -39,7 +44,8 @@ $(document).ready(function(){
}); });
// complete for queue item // complete for queue item
$('.order-complete').on('click',function(){ $('.order-complete').on('click',function(e){
//e.preventDefault();
var _self = $(this); // To know in ajax return var _self = $(this); // To know in ajax return
var assigned_item_id=$(this).attr('id').substr(15); var assigned_item_id=$(this).attr('id').substr(15);
var params = { 'id':assigned_item_id }; var params = { 'id':assigned_item_id };
@@ -72,6 +78,8 @@ $(document).ready(function(){
$("#completed_count").text(parseInt($("#completed_count").text()) + data.length); $("#completed_count").text(parseInt($("#completed_count").text()) + data.length);
alert("updated!"); alert("updated!");
// Page reload
location.reload();
} }
}); });
}); });

View File

@@ -19,10 +19,15 @@
//= require bootstrap-datepicker //= require bootstrap-datepicker
$(document).ready(function(){ $(document).ready(function(){
// auto refresh every 10 seconds
setTimeout(function(){
window.location.reload(1);
}, 10000);
// For selected order return // For selected order return
var order_status = ""; var order_status = "";
order_status = $(".selected-item").children().find(".orders-order-status").text().substr(0,6).trim(); order_status = $(".selected-item").children().find(".orders-order-status").text().substr(0,6).trim();
console.log(order_status) ;
// Enable/Disable Button // Enable/Disable Button
control_button(order_status); control_button(order_status);

View File

@@ -16,5 +16,6 @@
} }
.selected-item { .selected-item {
color: #fff !important;
background-color: blue; background-color: blue;
} }