From 49eb565e2a75afda63b9557db64b94ca4d506f45 Mon Sep 17 00:00:00 2001 From: simon Date: Sun, 2 Jan 2022 16:25:05 +0700 Subject: [PATCH] fix sort_by selected attribute and animation toggle --- .../home/templates/home/channel.html | 2 +- .../home/templates/home/channel_id.html | 32 +++++++++---------- .../home/templates/home/downloads.html | 2 +- tubearchivist/home/templates/home/home.html | 32 +++++++++---------- .../home/templates/home/playlist.html | 2 +- tubearchivist/static/css/style.css | 2 +- tubearchivist/static/script.js | 8 +++-- 7 files changed, 41 insertions(+), 39 deletions(-) diff --git a/tubearchivist/home/templates/home/channel.html b/tubearchivist/home/templates/home/channel.html index 8a1a944..44cda8a 100644 --- a/tubearchivist/home/templates/home/channel.html +++ b/tubearchivist/home/templates/home/channel.html @@ -8,7 +8,7 @@

Channels

- add-icon + add-icon
{% csrf_token %} diff --git a/tubearchivist/home/templates/home/channel_id.html b/tubearchivist/home/templates/home/channel_id.html index 199b348..e88825e 100644 --- a/tubearchivist/home/templates/home/channel_id.html +++ b/tubearchivist/home/templates/home/channel_id.html @@ -78,23 +78,23 @@ {% endif %}
-
-
-
- Sort by: - - -
+
+
+ Sort by: + +
- sort-icon +
+
+ sort-icon grid view list view
diff --git a/tubearchivist/home/templates/home/downloads.html b/tubearchivist/home/templates/home/downloads.html index 10daac9..43fb5ab 100644 --- a/tubearchivist/home/templates/home/downloads.html +++ b/tubearchivist/home/templates/home/downloads.html @@ -17,7 +17,7 @@

Start download

- add-icon + add-icon

Add to download queue

diff --git a/tubearchivist/home/templates/home/home.html b/tubearchivist/home/templates/home/home.html index a06f186..f29a15d 100644 --- a/tubearchivist/home/templates/home/home.html +++ b/tubearchivist/home/templates/home/home.html @@ -17,23 +17,23 @@ {% endif %}
-
-
-
- Sort by: - - -
+
+
+ Sort by: + +
- sort-icon +
+
+ sort-icon grid view list view
diff --git a/tubearchivist/home/templates/home/playlist.html b/tubearchivist/home/templates/home/playlist.html index b7ddd9b..9711f4b 100644 --- a/tubearchivist/home/templates/home/playlist.html +++ b/tubearchivist/home/templates/home/playlist.html @@ -7,7 +7,7 @@

Playlists

- add-icon + add-icon
{% csrf_token %} diff --git a/tubearchivist/static/css/style.css b/tubearchivist/static/css/style.css index 770fc8f..d745cc3 100644 --- a/tubearchivist/static/css/style.css +++ b/tubearchivist/static/css/style.css @@ -292,7 +292,7 @@ button:hover { .view-controls { display: grid; - grid-template-columns: 1fr 1fr; + grid-template-columns: 1fr auto auto; border-bottom: 2px solid; border-color: var(--accent-font-dark); margin: 15px 0; diff --git a/tubearchivist/static/script.js b/tubearchivist/static/script.js index f8af4ad..19f54c1 100644 --- a/tubearchivist/static/script.js +++ b/tubearchivist/static/script.js @@ -575,15 +575,17 @@ function showForm() { var displayStyle = formElement.style.display if (displayStyle === "") { formElement.style.display = 'block'; - animate('add-icon', 'pulse-img'); } else { formElement.style.display = ""; - } + }; + animate('animate-icon', 'pulse-img'); } function animate(elementId, animationClass) { var toAnimate = document.getElementById(elementId); if (toAnimate.className !== animationClass) { toAnimate.className = animationClass; - } + } else { + toAnimate.classList.remove(animationClass); + }; }