Skip to content

Commit

Permalink
another attempt to fix android field not blurring on login
Browse files Browse the repository at this point in the history
  • Loading branch information
webandtech committed May 10, 2011
1 parent 249dd9f commit 08a6af9
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/views.js
Expand Up @@ -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();
}
}
}
Expand All @@ -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();
}
});

Expand Down

0 comments on commit 08a6af9

Please sign in to comment.