Skip to content

Don't render training data on events page, fixes #936 #937

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 21, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions resources/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ $(document).ready(function() {
});
}

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

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