From 3a82dd12757034ea6158e8bd02454a2c7ae26c4d Mon Sep 17 00:00:00 2001 From: Charles Connell Date: Sun, 22 Dec 2013 17:23:34 -0500 Subject: [PATCH] Make autocomplete more clear #198 --- karmaworld/assets/js/add-course.js | 23 ++++++++------------ karmaworld/templates/partial/add_course.html | 4 ++-- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/karmaworld/assets/js/add-course.js b/karmaworld/assets/js/add-course.js index f005670..bec4290 100644 --- a/karmaworld/assets/js/add-course.js +++ b/karmaworld/assets/js/add-course.js @@ -19,29 +19,24 @@ $(function() { } } - // Set up the "Add Course" button at bottom - // of page - $('#add-course-btn').click(function() { + addCourse = function() { // Show the add a course form $('#add-course-form').show(); // Hide the add a course button $('#add-course-btn').hide(); + // Scroll the user's page to here + $('#add-course-divider').ScrollTo(); // Put focus in first input field $('#str_school').focus(); - }); + }; + + // Set up the "Add Course" button at bottom + // of page + $('#add-course-btn').click(addCourse); // Set up the "Add Course" button in the // page header - $('#add_course_header_button').click(function() { - // Show the add a course form - $('#add-course-form').show(); - // Hide the add a course button - $('#add-course-btn').hide(); - // Scroll the user's page to here - $('#add-course-divider').ScrollTo(); - // Put focus in first input field - $('#str_school').focus(); - }); + $('#add_course_header_button').click(addCourse); // Dismiss on exit x click FIXME $(".lightbox_close").click(function() { diff --git a/karmaworld/templates/partial/add_course.html b/karmaworld/templates/partial/add_course.html index 590f356..07e37a7 100644 --- a/karmaworld/templates/partial/add_course.html +++ b/karmaworld/templates/partial/add_course.html @@ -24,12 +24,12 @@ School {% if course_form.school.errors %} - * there was an error with this field + Please select a school from the drop-down {% endif %}
- +
-- 2.25.1