Skip to content

Commit

Permalink
Disable session purpose/timeslot type hiding on schedule editor when …
Browse files Browse the repository at this point in the history
…only 0 or 1 options

 - Legacy-Id: 19439
  • Loading branch information
jennifer-richards committed Oct 19, 2021
1 parent b6ac3d4 commit 446ac7a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 19 deletions.
14 changes: 8 additions & 6 deletions ietf/static/ietf/js/edit-meeting-schedule.js
Expand Up @@ -737,9 +737,10 @@ jQuery(document).ready(function () {
timeslots.filter(checked.join(",")).removeClass('hidden-timeslot-type');
timeslots.not(checked.join(",")).addClass('hidden-timeslot-type');
}

timeSlotTypeInputs.on("click", updateTimeSlotTypeToggling);
updateTimeSlotTypeToggling();
if (timeSlotTypeInputs.length > 0) {
timeSlotTypeInputs.on("click", updateTimeSlotTypeToggling);
updateTimeSlotTypeToggling();
}

// Toggling session purposes
let sessionPurposeInputs = content.find('.session-purpose-toggles input');
Expand All @@ -752,9 +753,10 @@ jQuery(document).ready(function () {
sessions.filter(checked.join(",")).removeClass('hidden-purpose');
sessions.not(checked.join(",")).addClass('hidden-purpose');
}

sessionPurposeInputs.on("click", updateSessionPurposeToggling);
updateSessionPurposeToggling();
if (sessionPurposeInputs.length > 0) {
sessionPurposeInputs.on("click", updateSessionPurposeToggling);
updateSessionPurposeToggling();
}

// toggling visible timeslots
let timeslotGroupInputs = content.find("#timeslot-group-toggles-modal .modal-body input");
Expand Down
30 changes: 17 additions & 13 deletions ietf/templates/meeting/edit_meeting_schedule.html
Expand Up @@ -199,19 +199,23 @@
{% endfor %}
</span>

<span class="toggle-inputs session-purpose-toggles">
Purpose:
{% for purpose in session_purposes %}
<label class="purpose-{{ purpose.slug }}"><input type="checkbox" checked value="{{ purpose.slug }}"> {{ purpose }}</label>
{% endfor %}
</span>

<span class="toggle-inputs timeslot-type-toggles">
Type:
{% for type in timeslot_types %}
<label class="timeslot-type-{{ type.slug }}"><input type="checkbox" checked value="{{ type.slug }}"> {{ type }}</label>
{% endfor %}
</span>
{% if session_purposes|length > 1 %}
<span class="toggle-inputs session-purpose-toggles">
Purpose:
{% for purpose in session_purposes %}
<label class="purpose-{{ purpose.slug }}"><input type="checkbox" checked value="{{ purpose.slug }}"> {{ purpose }}</label>
{% endfor %}
</span>
{% endif %}

{% if timeslot_types|length > 1 %}
<span class="toggle-inputs timeslot-type-toggles">
Type:
{% for type in timeslot_types %}
<label class="timeslot-type-{{ type.slug }}"><input type="checkbox" checked value="{{ type.slug }}"> {{ type }}</label>
{% endfor %}
</span>
{% endif %}
</div>
</div>
</div>
Expand Down

0 comments on commit 446ac7a

Please sign in to comment.