Skip to content

Commit

Permalink
Back porting to 1.9.x: Home Key doesn't work in the search boxes -
Browse files Browse the repository at this point in the history
TRUNK-3220
  • Loading branch information
dkayiwa committed May 24, 2013
1 parent af9a9f3 commit 7e5083e
Showing 1 changed file with 2 additions and 24 deletions.
Expand Up @@ -320,9 +320,9 @@ function OpenmrsSearch(div, showIncludeVoided, searchHandler, selectionHandler,

//catch control keys to stop the cursor in the input box from moving.
input.keydown(function(event) {
//UP(38), DOWN(40), HOME(36), END(35), PAGE UP(33), PAGE DOWN(34)
//UP(38), DOWN(40), PAGE UP(33), PAGE DOWN(34)
var kc = event.keyCode;
if(((kc >= 33) && (kc <= 36)) || (kc == 38) || (kc == 40)) {
if(kc == 33 || kc == 34 || kc == 38 || kc == 40) {
if(!(self._div.find(".openmrsSearchDiv").css("display") != 'none')) {
return true;
}
Expand All @@ -334,12 +334,6 @@ function OpenmrsSearch(div, showIncludeVoided, searchHandler, selectionHandler,
case 34:
self._doPageDown();
break;
case 35:
self._doKeyEnd();
break;
case 36:
self._doKeyHome();
break;
case 38:
self._doKeyUp();
break;
Expand Down Expand Up @@ -904,22 +898,6 @@ function OpenmrsSearch(div, showIncludeVoided, searchHandler, selectionHandler,
this._doSelected(selectedRowIndex, this._results[selectedRowIndex]);
},

_doKeyHome: function() {
this._table.fnPageChange('first');
if(this._isHighlightedRowOnVisiblePage())
return;

this._highlightRowOnPageFlip();
},

_doKeyEnd: function() {
this._table.fnPageChange('last');
if(this._isHighlightedRowOnVisiblePage())
return;

this._highlightRowOnPageFlip();
},

_doSelected: function(position, rowData) {
if(this.options.selectionHandler) {
this.options.selectionHandler(position, rowData);
Expand Down

0 comments on commit 7e5083e

Please sign in to comment.