Skip to content

Commit e136006

Browse files
committed
Don't render training data on events page, fixes #936
1 parent 1913835 commit e136006

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

Diff for: resources/js/functions.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ $(document).ready(function() {
404404
});
405405
}
406406

407-
// Render training data for our training page
407+
// Render training data for our front page
408408
var frontPageTrainingList = $('.training-items-list');
409409
// Stop early if the front page element does not exist
410410
if (frontPageTrainingList.length !== 0) {
@@ -444,10 +444,11 @@ $(document).ready(function() {
444444
});
445445
}
446446

447-
// Render training data for the front page
447+
// Render training data for the training page
448+
var pathname = window.location.pathname;
448449
var trainingPageItemList = $('.training-events .wrap .inner-box');
449-
// Stop early if the training page element does not exist
450-
if (trainingPageItemList.length !== 0) {
450+
// Check if we are on the training page and the training page element exists
451+
if (pathname.startsWith("/training") && trainingPageItemList.length !== 0) {
451452
getTrainings()
452453
.then(function (trainings) {
453454
var MAX_TRAININGS = 999;

0 commit comments

Comments
 (0)