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.
This commit is contained in:
Victor Shnayder
2013-02-24 19:44:41 -05:00
parent 01a38c29be
commit db06efae75

View File

@@ -144,6 +144,7 @@ var CohortManager = (function ($) {
$(".remove", tr).html('<a href="#">remove</a>')
.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;
});