From 97069cdd13a22b62337146fa39315da94a4a78b7 Mon Sep 17 00:00:00 2001 From: Brandon Green Date: Wed, 31 Mar 2021 15:13:55 -0400 Subject: [PATCH 1/2] Add function to randomize ecosystem cards on refresh --- ecosystem/ecosystem.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/ecosystem/ecosystem.html b/ecosystem/ecosystem.html index f2ef7d73c5e3..faf009fb0ffb 100644 --- a/ecosystem/ecosystem.html +++ b/ecosystem/ecosystem.html @@ -121,6 +121,18 @@

$(this).attr("data-date-added", date); }); + //Randomize Ecosystem cards on page reload + $.fn.randomize = function(ecosystemCards) { + (ecosystemCards ? this.find(ecosystemCards) : this).parent().each(function() { + $(this).children(ecosystemCards).sort(function() { + return Math.random() - 0.5; + }).detach().appendTo(this); + }); + return this; + }; + + $('#ecosystem-index-cards').randomize('#ecosystemCards'); + From 02e11ad6f197cd65105bb6d03d1c7e021993efaa Mon Sep 17 00:00:00 2001 From: Brandon Green Date: Wed, 31 Mar 2021 15:19:15 -0400 Subject: [PATCH 2/2] Fix indentation --- ecosystem/ecosystem.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ecosystem/ecosystem.html b/ecosystem/ecosystem.html index faf009fb0ffb..e3397a527a9e 100644 --- a/ecosystem/ecosystem.html +++ b/ecosystem/ecosystem.html @@ -124,9 +124,9 @@

//Randomize Ecosystem cards on page reload $.fn.randomize = function(ecosystemCards) { (ecosystemCards ? this.find(ecosystemCards) : this).parent().each(function() { - $(this).children(ecosystemCards).sort(function() { - return Math.random() - 0.5; - }).detach().appendTo(this); + $(this).children(ecosystemCards).sort(function() { + return Math.random() - 0.5; + }).detach().appendTo(this); }); return this; };