Changeset - 59ee50e4d13c
[Not reviewed]
default
0 1 0
Nathan Brink (binki) - 15 years ago 2010-10-29 19:45:23
ohnobinki@ohnopublishing.net
Automatically add a new class each time an auto.php?getsections AJAX call returns a valid list of sections to reduce user confusion about how to use autocomplete.
1 file changed with 10 insertions and 1 deletions:
0 comments (0 inline, 0 general)
scripts/scheduleInput.js
Show inline comments
 
@@ -175,6 +175,11 @@ function add_sections(cnum, data)
 
    var i;
 
    if (!data.sections)
 
	return;
 
    /*
 
     * we get the sections in the correct order. For the user to see
 
     * them in the correct order, we must reverse the add_setion_n()
 
     * calls.
 
     */
 
    for (i = data.sections.length - 1; i >= 0; i --)
 
	{
 
	    section = data.sections[i];
 
@@ -203,7 +208,11 @@ function add_sections(cnum, data)
 
							  context: {'class_num': event.data.class_num},
 
							  success: function(data, textStatus, reqobj)
 
							      {
 
								  add_sections(this.class_num, data);
 
								  if (data.sections)
 
								      {
 
									  add_sections(this.class_num, data);
 
									  add_class();
 
								      }
 
							      }
 
						      }
 
						      );
0 comments (0 inline, 0 general)