Commit f2e1da75 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review

Merge "Bug 1687494: Allow enter key to submit Admin -> User search form"

parents f9fb6330 0c9f2ff8
......@@ -20,6 +20,7 @@ var UserSearch = (function($) {
self.rewriteHeaders();
self.rewriteInitials();
self.rewriteQueryButton();
self.rewriteQueryField();
self.rewriteCheckboxes();
self.rewriteLoggedInFilter();
self.rewriteDuplicateEmailFilter();
......@@ -106,18 +107,30 @@ var UserSearch = (function($) {
this.rewriteQueryButton = function() {
$('#query-button').click(function() {
pager.params.offset = 0;
pager.params.query = $('#query').val();
var institution = $('#institution');
if (institution) {
pager.params.institution = institution.val();
}
var institution_requested = $('#institution_requested');
if (institution_requested) {
pager.params.institution_requested = institution_requested.val();
self.submitUserQuery();
});
};
this.submitUserQuery = function() {
pager.params.offset = 0;
pager.params.query = $('#query').val();
var institution = $('#institution');
if (institution) {
pager.params.institution = institution.val();
}
var institution_requested = $('#institution_requested');
if (institution_requested) {
pager.params.institution_requested = institution_requested.val();
}
pager.sendQuery();
return false;
};
this.rewriteQueryField = function() {
$('#query').on('keypress', function(event) {
if (event.keyCode == 13) {
self.submitUserQuery();
}
pager.sendQuery();
return false;
});
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment