Skip to content

Commit

Permalink
SAK-33411 Pressing 'Enter' while the search box has focus will press …
Browse files Browse the repository at this point in the history
…the 'Download' button instead of 'Find' (sakaiproject#6010)
  • Loading branch information
josecebe authored and Miguel Pellicer committed Sep 18, 2018
1 parent 4044a76 commit e94f90d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 9 additions & 1 deletion sections/sections-app/src/webapp/js/sections.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,4 +297,12 @@ function update(management) {
}
document.getElementById('optionsForm:confirmExternallyManagedButton').click();
return false;
}
}

function submitSearchText(event) {
var charCode = event.charCode;
if (event.keyCode === 13) {
event.preventDefault();
$('#rosterForm\\:searchButton').click();
}
}
2 changes: 1 addition & 1 deletion sections/sections-app/src/webapp/roster.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

<h:panelGrid styleClass="sectionContainerNav" columns="1" columnClasses="sectionLeftNav,sectionRightNav">
<t:div>
<h:inputText id="search" value="#{rosterBean.searchText}"
<h:inputText id="search" onkeydown="submitSearchText(event)" value="#{rosterBean.searchText}"
onfocus="clearIfDefaultString(this, '#{msgs.roster_search_text}')"/>
<h:commandButton value="#{msgs.roster_search_button}" actionListener="#{rosterBean.search}"/>
<h:commandButton value="#{msgs.roster_clear_button}" actionListener="#{rosterBean.clearSearch}"/>
Expand Down

0 comments on commit e94f90d

Please sign in to comment.