From db06efae75d2646e1ad649d4ad27f03a316311dc Mon Sep 17 00:00:00 2001 From: Victor Shnayder Date: Sun, 24 Feb 2013 19:44:41 -0500 Subject: [PATCH] Prevent scroll-to-top on clicks in cohorts views Have to return false from event handlers to avoid href="#" links from sending the user to the top of the page. --- common/static/js/course_groups/cohorts.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/common/static/js/course_groups/cohorts.js b/common/static/js/course_groups/cohorts.js index 97837c6bac..2c9904ef40 100644 --- a/common/static/js/course_groups/cohorts.js +++ b/common/static/js/course_groups/cohorts.js @@ -144,6 +144,7 @@ var CohortManager = (function ($) { $(".remove", tr).html('remove') .click(function() { remove_user_from_cohort(item.username, current_cohort_id, tr); + return false; }); detail_users.append(tr); @@ -217,6 +218,7 @@ var CohortManager = (function ($) { show_cohorts_button.click(function() { state = state_summary; render(); + return false; }); add_cohort_input.change(function() { @@ -231,12 +233,14 @@ var CohortManager = (function ($) { var add_url = url + '/add'; data = {'name': add_cohort_input.val()} $.post(add_url, data).done(added_cohort); + return false; }); add_members_button.click(function() { var add_url = detail_url + '/add'; data = {'users': users_area.val()} $.post(add_url, data).done(added_users); + return false; });