Permalink
Browse files

another attempt to fix android field not blurring on login

  • Loading branch information...
1 parent 249dd9f commit 08a6af9dfe4e6f43d5ced6b4101cc2e272dc7a49 @webandtech committed May 10, 2011
Showing with 11 additions and 3 deletions.
  1. +11 −3 src/views.js
View
@@ -47,13 +47,18 @@ function setUpViews() {
keyup: function(fld, e){
if (e.browserEvent.keyCode == 13) {
e.stopEvent();
+ if (Ext.is.Android) {
+ setTimeout(function() {Ext.getCmp('passwordField').blur();},300); // Android has trouble blurring fields when the keyboard is half open
+ }
+ else {
+ fld.fieldEl.dom.blur();
+ }
Ext.CTCT.login(userNameField.getValue(),passwordField.getValue(),function(){
refreshEventsList();
});
//also clear the fields so if they come back to the login screen they have a clean slate
userNameField.reset();
passwordField.reset();
- fld.fieldEl.dom.blur();
}
}
}
@@ -66,15 +71,18 @@ function setUpViews() {
handler: function() {
if (Ext.is.Android) {
window.KeyBoard.hideKeyBoard(); // stupid Android... needs me to tell it to close the keyboard!
+ setTimeout(function() {Ext.getCmp('passwordField').blur();Ext.getCmp('userNameField').blur();},300); // Android has trouble blurring fields when the keyboard is half open
+ }
+ else {
+ passwordField.blur();
+ userNameField.blur();
}
//login with callback to get the events list
Ext.CTCT.login(userNameField.getValue(),passwordField.getValue(),function() {
refreshEventsList();
});
userNameField.reset();
passwordField.reset();
- passwordField.blur();
- userNameField.blur();
}
});

0 comments on commit 08a6af9

Please sign in to comment.