add function for update page page automatically
This commit is contained in:
parent
b39ccea0d5
commit
1db2115fb0
|
@ -6,6 +6,13 @@
|
|||
- platform = product.platform
|
||||
|
||||
%h3= t("layout.product_build_lists.main_data")
|
||||
.both
|
||||
|
||||
%div.reloader
|
||||
= label_tag :autoreload do
|
||||
= check_box_tag :autoreload, true, true
|
||||
= t("layout.autoreload_page")
|
||||
.both
|
||||
|
||||
.leftlist= t("activerecord.attributes.product_build_list.id")
|
||||
.rightlist= pbl.id
|
||||
|
@ -41,7 +48,7 @@
|
|||
|
||||
- if @logs.present?
|
||||
%h3= t("layout.product_build_lists.logs")
|
||||
%table.tablesorter.width565{:cellpadding => "0", :cellspacing => "0"}
|
||||
%table#logs.tablesorter.width565{:cellpadding => "0", :cellspacing => "0"}
|
||||
%thead
|
||||
%tr
|
||||
%th= '#'
|
||||
|
@ -73,4 +80,20 @@
|
|||
|
||||
|
||||
:javascript
|
||||
$(function(){
|
||||
$('article .all').addClass('bigpadding');
|
||||
|
||||
var reloadChange = function() {
|
||||
if ($(this).is(':checked')) {
|
||||
//reload page every 1 minute
|
||||
t = setTimeout(function() {
|
||||
window.location.reload();
|
||||
}, 10000);
|
||||
} else {
|
||||
clearTimeout(t);
|
||||
}
|
||||
}
|
||||
|
||||
$('#autoreload').on('change', reloadChange)
|
||||
.trigger('change');
|
||||
});
|
Loading…
Reference in New Issue