Skip to content
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

Fixed Show Past Events Toggle on Past Terms #1389

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions app/static/js/event_list.js → app/static/js/eventList.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,20 @@ $(document).ready(function(){
rsvpForEvent($("#rsvpBtn").val())
})
//ensure that toggle state is consistent across terms
var toggleState = sessionStorage.getItem('toggleState') || 'unchecked';
var viewPastEventsToggle = $("#viewPastEventsToggle");
viewPastEventsToggle.prop('checked', toggleState === 'checked');
if (!g_isPastTerm) {
var toggleState = sessionStorage.getItem('toggleState') || 'unchecked';
var viewPastEventsToggle = $("#viewPastEventsToggle");
viewPastEventsToggle.prop('checked', toggleState === 'checked');

} else {
var viewPastEventsToggle = $("#viewPastEventsToggle");
viewPastEventsToggle.prop('checked', true);
}
var isChecked = viewPastEventsToggle.prop("checked");
toggleRows(isChecked);

updateIndicatorCounts(isChecked)

//update indicator numbers when toggle is changed
viewPastEventsToggle.on("change", function(){
if (!g_isPastTerm) {
Expand Down
2 changes: 1 addition & 1 deletion app/templates/events/eventList.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{{super()}}
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.12.1/js/bootstrap-select.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script src="/static/js/event_list.js"></script>
<script src="/static/js/eventList.js"></script>
<script src="/static/js/emailModal.js"></script>
{% endblock %}
{% block styles %}
Expand Down
2 changes: 1 addition & 1 deletion app/templates/events/eventView.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

{% block scripts %}
{{super()}}
<script src="/static/js/event_list.js"></script>
<script src="/static/js/eventList.js"></script>
{% endblock %}

{% block app_content %}
Expand Down