<!doctype html>
<html lang="en">
<head>
<?php getTemplate('head') ?>
<title><?= HTML_DASHBOARD_TITLE ?> Заявки</title>
</head>
<body>
<?php getTemplate('dashboard/menu') ?>
<main class="main dashboard-page dashboard-page-users" id="dashboardPageUsersTable">
<div class="main-content">
<div class="dashboard-table-tools">
<div>
<?php generateCustomSelect('userGroup', $groups) ?>
</div>
<a href="<?= PROJECT_DASHBOARD_USERS_ADD_WEBPATH ?>" class="dashboard-table-tools-link">добавить
пользователя</a>
</div>
<table class="dashboard-table" v-html="usersTable"></table>
</div>
</main>
<?php getTemplate('scripts') ?>
<script>
new Vue({
el: '#dashboardPageUsersTable',
data: function() {
return {
userGroup: "all",
usersTable: ""
},
},
mounted() {
this.userGroupOnChange();
},
methods: {
userGroupOnChange: function () {
fetch('http://site.name/api/v1/getUsersTable?mode=' + this.userGroup)
.then((response) => {
if (response.ok) {
return response.text();
} else {
throw new Error('Network response was not ok');
}
}
)
.then((response) => {
this.usersTable = response;
})
.then((response) => {
this.$forceUpdate();
updateHandlers();
})
.catch((error) => {
console.log(error);
});
}
}
}
)
</script>
<script>
function updateHandlers() {
$('.dashboard-table-row-tools').on('click', function (e) {
$('.dashboard-table-row-tools').removeClass('dashboard-table-row-tools-active');
$(this).addClass('dashboard-table-row-tools-active');
});
$(document).on('click', function (e) {
if ($(e.target).closest('.dashboard-table-row-tools').length === 0) {
$('.dashboard-table-row-tools').removeClass('dashboard-table-row-tools-active');
}
})
}
</script>
</body>
</html>
data: function() {
return {
userGroup: "all",
usersTable: ""
},
},
$(document).ready(function() {
if ($(".swiper-container1").length > 0) {
var lastMoveEvent;
var swiper = new Swiper(".swiper-container1", {
slidesPerView: 8,
loop: true,
autoplay: {
delay: 0,
disableOnInteraction: false
},
speed: 7000
});
swiper.on("touchMove", event => {
if (lastMoveEvent) {
var sliderMovedToLeft = event.clientX - lastMoveEvent.clientX < 0;
var sliderMovedToRight = event.clientX - lastMoveEvent.clientX > 0;
sliderMovedToLeft !== sliderMovedToRight &&
console.log(
"movedToLeft/movedToRight",
sliderMovedToLeft,
sliderMovedToRight
);
}
lastMoveEvent = event;
});
}
}
Попробуйте заменить
setTimeout('updateExamTimer()', 1000);
на
ну и при отключении интернета вызывайте
clearTimeout(window.examTimerId)
Это конечно, не очень хорошая практика, но в вашем случае, выглядит, как самый оптимальный вариант.