-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add dropdown to sort completed demons on stats viewers #211
base: master
Are you sure you want to change the base?
Add dropdown to sort completed demons on stats viewers #211
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #211 +/- ##
==========================================
- Coverage 29.61% 29.30% -0.31%
==========================================
Files 116 114 -2
Lines 8314 8262 -52
==========================================
- Hits 2462 2421 -41
+ Misses 5852 5841 -11 ☔ View full report in Codecov by Sentry. |
Mhh, yeah, sorry, suggesting cookies was wrong of me, I meant local storage 😭 I meant localstorage. The tabbed pane stuff (e.g. what allows you to select tabs in the user area and restores your selects tab after reloading) in pointercrate-core-pages/static/js/modules/tab.js already does something like this. |
Let's do it for both, the initialization of the dropdown can be moved into the stats viewer base class, and from there it can probably even re-trigger the abstract population routine. I also still think that when its set to "by difficulty", it shouldn't populate everything into the same list, but rather use separate lists for main/extended/legacy demons. fwiw, |
oh 😭 i guess i didn't need to modify |
An implementation of #208, adds a dropdown which allows the user to choose between two sorting options
The selected value is saved in cookies, where the default value of the
simple_dropdown
is set to the cookie value.In the Javascript (only in the
IndividualStatsViewer
class), the code that populates the stats containers is moved from theonReceive
function to its ownpopulateStatsContainers
function, so the stats containers can be repopulated without sending another requestCurrently, it's only implemented in the individual stats viewer, but I could see this feature being nice to have in the nation stats viewer as well so I'm open to making changes
I'm not entirely sure if handling all of the cookie stuff in the backend is the greatest idea, my second thought would be to just modify the dropdown's selected value to the cookie value (or maybe just a value in
localStorage
) once it's initialized in the JS, but I'm not quite sureLicense Acceptance
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.