Skip to content

Commit

Permalink
Merge pull request #179 from jacksonchen/issue_149
Browse files Browse the repository at this point in the history
Solves Issue 149
  • Loading branch information
ElDeveloper committed Aug 29, 2013
2 parents 9166061 + 986c543 commit c841fa8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion emperor/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def format_emperor_html_footer_string(has_biplots=False, has_ellipses=False,
</ul>
<div id="keytab">
<form name="keyFilter">
<label>Filter </label><input name="filterBox" type="text" onkeyup="filterKey()"></input>
<label>Filter </label><input name="filterBox" id="searchBox" type="text" onkeyup="filterKey()"></input>
</form>
<div id="key">
</div>
Expand Down
10 changes: 8 additions & 2 deletions emperor/support_files/emperor/js/emperor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2002,6 +2002,13 @@ $(document).ready(function() {
if (g_validAsciiCodes.indexOf(code)==-1)
event.preventDefault();
});

// Disables the enter key in the search bar
$('#searchBox').keypress(function(event) {
if (event.keyCode == 13) {
event.preventDefault();
}
});

init();
animate();
Expand Down Expand Up @@ -2277,5 +2284,4 @@ $(document).ready(function() {
g_mainRenderer.render( g_mainScene, g_sceneCamera);
}


});
});
10 changes: 5 additions & 5 deletions tests/test_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,7 +493,7 @@ def test_format_emperor_html_footer_string(self):
</ul>
<div id="keytab">
<form name="keyFilter">
<label>Filter </label><input name="filterBox" type="text" onkeyup="filterKey()"></input>
<label>Filter </label><input name="filterBox" id="searchBox" type="text" onkeyup="filterKey()"></input>
</form>
<div id="key">
</div>
Expand Down Expand Up @@ -656,7 +656,7 @@ def test_format_emperor_html_footer_string(self):
</ul>
<div id="keytab">
<form name="keyFilter">
<label>Filter </label><input name="filterBox" type="text" onkeyup="filterKey()"></input>
<label>Filter </label><input name="filterBox" id="searchBox" type="text" onkeyup="filterKey()"></input>
</form>
<div id="key">
</div>
Expand Down Expand Up @@ -830,7 +830,7 @@ def test_format_emperor_html_footer_string(self):
</ul>
<div id="keytab">
<form name="keyFilter">
<label>Filter </label><input name="filterBox" type="text" onkeyup="filterKey()"></input>
<label>Filter </label><input name="filterBox" id="searchBox" type="text" onkeyup="filterKey()"></input>
</form>
<div id="key">
</div>
Expand Down Expand Up @@ -988,7 +988,7 @@ def test_format_emperor_html_footer_string(self):
</ul>
<div id="keytab">
<form name="keyFilter">
<label>Filter </label><input name="filterBox" type="text" onkeyup="filterKey()"></input>
<label>Filter </label><input name="filterBox" id="searchBox" type="text" onkeyup="filterKey()"></input>
</form>
<div id="key">
</div>
Expand Down Expand Up @@ -1150,7 +1150,7 @@ def test_format_emperor_html_footer_string(self):
</ul>
<div id="keytab">
<form name="keyFilter">
<label>Filter </label><input name="filterBox" type="text" onkeyup="filterKey()"></input>
<label>Filter </label><input name="filterBox" id="searchBox" type="text" onkeyup="filterKey()"></input>
</form>
<div id="key">
</div>
Expand Down

0 comments on commit c841fa8

Please sign in to comment.