This commit is contained in:
Juan Ferrer Toribio 2017-09-22 13:12:07 +02:00
commit a6e2657618
1 changed files with 14 additions and 1 deletions

View File

@ -165,16 +165,29 @@ var App =
_onKeyPress: function (e) _onKeyPress: function (e)
{ {
var target = event.target || event.srcElement;
switch (e.keyCode) switch (e.keyCode)
{ {
case 13: // Enter case 13: // Enter
this._onEnterClick (); this._onEnterPress (target);
break; break;
case 27: // Esc case 27: // Esc
window.close (); window.close ();
break; break;
} }
}, },
_onEnterPress: function(target)
{
if ( target && target.id == 'user' && this.$('password').value == '')
{
this.$('password').focus ();
return;
}
this._onEnterClick ();
},
_onEnterClick: function () _onEnterClick: function ()
{ {