|
From: <cod...@go...> - 2009-05-28 17:53:16
|
Author: ke...@se...
Date: Thu May 28 10:52:36 2009
New Revision: 1367
Modified:
trunk/andro/clib/x6.js
Log:
Google #25, follow-up to #14, Prevent TAB key from processing while
auto-complete searches are in progress.
Fixes issue 25
Status: Verified
Modified: trunk/andro/clib/x6.js
==============================================================================
--- trunk/andro/clib/x6.js (original)
+++ trunk/andro/clib/x6.js Thu May 28 10:52:36 2009
@@ -3125,6 +3125,7 @@
// cancelling prior searches if the user keeps typing.
var x6selectJSON = {
JSON: false,
+ active: false,
request: function(inp,val) {
// First thing is to cancel current request
@@ -3132,9 +3133,16 @@
//if(this.JSON.http) {
// this.JSON.http.abort();
//}
+ if(this.JSON.http.abort) {
+ //this.JSON.http.abort();
+ }
+ //this.JSON.http.abort();
+ this.active = false;
+ //delete this.JSON;
this.JSON = false;
}
this.JSON = new x6JSON('x6page',x6.p(inp,'x6seltab'));
+ this.active = true;
this.JSON.addParm('x6select','Y');
this.JSON.addParm('gpletters',val);
@@ -3150,6 +3158,7 @@
this.JSON.execute(true,true,false
,function() {
x6inputs.x6select.display(inp,null,x6.data.x6select);
+ x6selectJSON.active=false;
}
);
}
@@ -3462,8 +3471,16 @@
// we have to work out the next control to give focus
// to, either forward or backward
if(isTab) {
+ // KFD 5/28/09 Google #25 disable tab on auto-complete
+ // while search is in progress.
+ if(x6selectJSON.active) {
+ $(e).stopPropagation();
+ console.log("Stopping propagation");
+ x6.console.log("Tab during auto-complete search,
discarding keystroke.");
+ x6.console.groupEnd();
+ return false;
+ }
x6.console.log("Tab key hit, returning true");
- x6.console.groupEnd();
return true;
}
if(!e.shiftKey) {
@@ -3574,10 +3591,14 @@
x6inputs.x6select.hide();
// KFD 5/27/09 Google #14 Must fetch
if($(inp).prop('xtableidpar','')!='') {
- x6.json.init('x6fetch',$(inp).attr('xtableid'));
- x6.json.addParm('x6col',$(inp).attr('xcolumnid'));
- x6.json.addParm('x6val',$(inp).val());
- x6.json.execute(true,true);
+ // KFD 5/28/09 Google # 25 Make independent objects
+ // to smooth out what happens when user
+ // is typing very quickly on auto-select
+ // and then hits TAB.
+ var json = new x6JSON('x6fetch',$(inp).attr('xtableid'));
+ json.addParm('x6col',$(inp).attr('xcolumnid'));
+ json.addParm('x6val',$(inp).val());
+ json.execute(true,true);
}
x6.console.log("Input Blur DONE");
x6.console.groupEnd();
|