mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2025-11-05 04:46:03 +01:00
Add keepalive only on pages with data-grav-keepalive="true". Add data-grav-keepalive="true" to blueprints partials so all blueprints-generated forms are covered
This commit is contained in:
@@ -518,9 +518,10 @@ $(function () {
|
||||
remodal.find('.button.continue').attr('href', $(e.target).attr('href'));
|
||||
});
|
||||
|
||||
// Keep-alive
|
||||
// Setup keep-alive on pages that have at least one element with data-grav-keepalive="true" set
|
||||
if ($(document).find('[data-grav-keepalive="true"]').length > 0) {
|
||||
setInterval(function() {
|
||||
keepAlive();
|
||||
}, (GravAdmin.config.admin_timeout/2)*1000); //Call keepAlive() 60s before the admin session timeouts
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% set form_id = form_id ? form_id : 'blueprints' %}
|
||||
|
||||
<form id="{{ form_id }}" method="post" data-grav-form="{{ form_id }}">
|
||||
<form id="{{ form_id }}" method="post" data-grav-form="{{ form_id }}" data-grav-keepalive="true">
|
||||
{% for field in blueprints.fields %}
|
||||
{% if field.type %}
|
||||
{% set value = data.value(field.name) %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% set form_id = form_id ? form_id : 'blueprints' %}
|
||||
|
||||
<form id="{{ form_id }}" method="post" data-grav-form="{{ form_id }}">
|
||||
<form id="{{ form_id }}" method="post" data-grav-form="{{ form_id }}" data-grav-keepalive="true">
|
||||
{% for field in blueprints.fields %}
|
||||
{% if field.type %}
|
||||
{% set value = data.value(field.name) %}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{% set form_id = form_id ? form_id : 'blueprints' %}
|
||||
|
||||
<form id="{{ form_id }}" method="post" data-grav-form="{{ form_id }}">
|
||||
<form id="{{ form_id }}" method="post" data-grav-form="{{ form_id }}" data-grav-keepalive="true">
|
||||
{% for field in blueprints.fields %}
|
||||
{% if field.type %}
|
||||
{% set value = data.value(field.name) %}
|
||||
|
||||
Reference in New Issue
Block a user