|
@@ -0,0 +1,25 @@
|
|
1
|
+function sort_posts(id) {
|
|
2
|
+ console.log("Executing function.");
|
|
3
|
+ var value = document.getElementById("my-selection").value;
|
|
4
|
+ console.log(value);
|
|
5
|
+
|
|
6
|
+ var parentNode = document.getElementById("rows-parent");
|
|
7
|
+ var instagramRow = document.getElementById("instagram-row");
|
|
8
|
+ var podcastsRow = document.getElementById("podcasts-row");
|
|
9
|
+ var articlesRow = document.getElementById("articles-row");
|
|
10
|
+ if (value == 1) {
|
|
11
|
+ parentNode.appendChild(podcastsRow);
|
|
12
|
+ parentNode.appendChild(instagramRow);
|
|
13
|
+ parentNode.appendChild(articlesRow);
|
|
14
|
+ }
|
|
15
|
+ else if (value == 2) {
|
|
16
|
+ parentNode.appendChild(instagramRow);
|
|
17
|
+ parentNode.append(articlesRow);
|
|
18
|
+ parentNode.appendChild(podcastsRow);
|
|
19
|
+ }
|
|
20
|
+ else if (value == 3) {
|
|
21
|
+ parentNode.append(articlesRow);
|
|
22
|
+ parentNode.appendChild(podcastsRow);
|
|
23
|
+ parentNode.appendChild(instagramRow);
|
|
24
|
+ }
|
|
25
|
+}
|