Changeset - ae13413f1878
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 14 years ago 2012-02-15 13:26:36
ohnobinki@ohnopublishing.net
Only show the course slot information to the user for the courses which have multiple slots.
1 file changed with 13 insertions and 8 deletions:
0 comments (0 inline, 0 general)
scripts/scheduleInput.js
Show inline comments
 
@@ -75,13 +75,13 @@ var slate_permutate_course_free = -1;
 
 *   Whether or not we should divulge the existence of course slots to
 
 *   the user.
 
 *
 
 * This will automatically be set to true as soon as a course
 
 * utilizing multiple slots is added using autocomplete.
 
 */
 
var show_course_slots = false;
 
var show_course_slots = [];
 

	
 
/*
 
 * General Input Functions
 
 */
 

	
 
/**
 
@@ -318,26 +318,26 @@ function add_sections(cnum, data)
 
 *   The idenfifier of the slot.
 
 */
 
function course_add_slot_row(course_i, slot_id)
 
{
 
    var extra_classes = '';
 

	
 
    if (!show_course_slots)
 
    if (!show_course_slots[course_i])
 
    {
 
	var aclass;
 
	/*
 
	 * Then check if this course has multiple slots and we should
 
	 * enable displaying them to the user.
 
	 */
 
	aclass = jQuery('.' + safe_css_class('class' + course_i) + '.section .section-slot-entry');
 
	if (aclass.length && aclass.val() != slot_id)
 
	{
 
	    enable_course_slots();
 
	    enable_course_slots(course_i);
 
	}
 
    }
 
    if (!show_course_slots)
 
    if (!show_course_slots[course_i])
 
	extra_classes += ' tr-slot-id-hidden';
 

	
 
    jQuery('tr.class' + course_i + ':last').after(
 
	'<tr class="class' + course_i + ' tr-slot-id ' + safe_css_class('slot-' + slot_id) + extra_classes + '">\n' +
 
	    '  <td><span /></td>\n' +
 
	    '  <td colspan="10"><span class="slot-id-text" /></td>\n' +
 
@@ -346,19 +346,24 @@ function course_add_slot_row(course_i, s
 
    );
 
    jQuery('tr.class' + course_i + ':last .slot-id-text').text('The following are ' + slot_id + ' sections and will be scheduled as a group.');
 
}
 

	
 
/**
 
 * \brief
 
 * Dynamically enable the displification of course slots to the user.
 
 *   Dynamically enable the displification of course slots to the
 
 *   user.
 
 *
 
 * \param course_i
 
 *   The particular course for which slot displification should be
 
 *   enabled.
 
 */
 
function enable_course_slots()
 
function enable_course_slots(course_i)
 
{
 
    show_course_slots = true;
 
    show_course_slots[course_i] = true;
 

	
 
    jQuery('.tr-slot-id-hidden').removeClass('tr-slot-id-hidden');
 
    jQuery('.' + safe_css_class('class' + course_i) + '.tr-slot-id-hidden').removeClass('tr-slot-id-hidden');
 
}
 

	
 
/**
 
 * \brief
 
 *   Adds a new class to the input.
 
 *
0 comments (0 inline, 0 general)