Skip to content

Commit

Permalink
Get rid of turbolinks:load and apply directly
Browse files Browse the repository at this point in the history
This is to avoid caching issues.
  • Loading branch information
Splines committed Aug 4, 2024
1 parent 60c809a commit 270dcf4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions app/assets/javascripts/annotations_overview.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$(document).on("turbolinks:load", function () {
function colorAnnotationCardsSharedByStudents() {
const annotationCards = $("[data-annotation-card-category]");
for (let card of annotationCards) {
const category = card.dataset.annotationCardCategory;
Expand All @@ -8,4 +8,6 @@ $(document).on("turbolinks:load", function () {
const color = Category.getByName(category).color;
card.style.borderColor = color;
}
});
}

colorAnnotationCardsSharedByStudents();
3 changes: 2 additions & 1 deletion app/views/annotations/annotations_overview.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<%= stylesheet_link_tag 'annotations_overview' %>
<%= javascript_include_tag :annotations_overview %>

<div class="container-md small-width">

Expand Down Expand Up @@ -64,3 +63,5 @@


</div>

<%= javascript_include_tag :annotations_overview %>

0 comments on commit 270dcf4

Please sign in to comment.