Skip to content

Commit

Permalink
[0.85] Submit search of entity on enter press; fix #116
Browse files Browse the repository at this point in the history
  • Loading branch information
orthagh committed Sep 15, 2015
1 parent 02cd324 commit 36a5994
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions inc/entity.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -837,8 +837,10 @@ static function showSelector($target, $myname) {
__s('Show all')."\">".str_replace(" ","&nbsp;",__('Show all'))."</a></div>";

echo "<div class='left' style='width:100%'>";
echo "<form id='entsearchform'>";
echo Html::input('entsearchtext', array('id' => 'entsearchtext'));
echo Html::submit(__('Search'), array('id' => 'entsearch'));
echo "</form>";

echo "<script type='text/javascript'>";
echo Html::jsGetElementbyID("tree_projectcategory$rand")."
Expand Down Expand Up @@ -893,12 +895,15 @@ static function showSelector($target, $myname) {
function (e, data) {
document.location.href = data.rslt.obj.children('a').attr('href');
});
$('#entsearch').click(function () {
$('#entsearchform').submit(function( event ) {
// cancel submit of entity search form
event.preventDefault();
".Html::jsGetElementbyID("tree_projectcategory$rand").".jstree('close_all');;
".Html::jsGetElementbyID("tree_projectcategory$rand").
".jstree('search',".Html::jsGetDropdownValue('entsearchtext').");
});
";


Expand Down

0 comments on commit 36a5994

Please sign in to comment.