Changeset 2488


Ignore:
Timestamp:
Jun 5, 2014, 1:29:18 PM (9 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #602: Focus fields on the YubiKey? tab

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.yubikey/trunk/resources/edit-user.js

    r2259 r2488  
    1313    Events.doOnEnter('yubiKeyOtp', yubikey.verifyOtp);
    1414    Buttons.addClickHandler('btnYubiKeyRemove', yubikey.removeYubiKey);
     15   
     16    TabControl.addTabActivateListener('settings.yubikey-tab', yubikey.autoFocus);
     17  }
     18 
     19  // If the user has a YubiKey set focus to the serial number field, otherwise the YubiKey OTP field
     20  yubikey.autoFocus = function()
     21  {
     22    if (Doc.element('ep.yubiKeyId').value)
     23    {
     24      Doc.element('yubiKeySerial').focus();
     25    }
     26    else
     27    {
     28      Doc.element('yubiKeyOtp').focus();
     29    }
    1530  }
    1631 
     
    99114    Doc.show('has-yubikey');
    100115    Doc.hide('no-yubikey');
     116    Doc.element('yubiKeySerial').focus();
    101117  }
    102118 
Note: See TracChangeset for help on using the changeset viewer.