Skip to content
Browse files

Fixed 'Type to Filter' in IE. Closes #122.

  • Loading branch information...
1 parent 5b454ed commit 2ec39dcaf9202381be437c6f5515ebfe3ef1cd8c cgroskopf committed Jun 13, 2011
Showing with 4 additions and 3 deletions.
  1. +4 −3 censusweb/media/js/query.js
View
7 censusweb/media/js/query.js
@@ -78,7 +78,7 @@ $(function(){
$(document).keypress(this.keypress);
}
- document.onkeydown = this.keydown;
+ $(document).keydown(this.keydown);
this.bind('change', this.render);
//this.bind('change', this.loadNext);
this.mappings.summarylevelDisplays[SUMLEV_TRACT] = 'Tracts';
@@ -161,15 +161,16 @@ $(function(){
_this.lazyRender();
}
},
+
keypress: function(e) {
if (e.which == 13) {
if (this.filter) {
$('ol .link:first').trigger('click');
} else if (this.isCompletable()) {
this.go();
}
- } else if (e.charCode && this.isFilterable()) {
- this.filter += String.fromCharCode(e.charCode);
+ } else if (e.which && this.isFilterable()) {
+ this.filter += String.fromCharCode(e.which);
this.lazyRender();
}
},

0 comments on commit 2ec39dc

Please sign in to comment.
Something went wrong with that request. Please try again.