function ensurePinKeyboardLoaded(onLoaded) {
  'use strict';

  // The element we want to see if loaded.
  var getPinKeyboard = function() {
    return $('pod-row').querySelectorAll('pin-keyboard')[0];
  };

  // Do not reload assets if they are already loaded. Run |onLoaded| once assets
  // are done loading, though.
  if (cr.ui.login.ResourceLoader.hasDeferredAssets('custom-elements')) {
    cr.ui.login.ResourceLoader.waitUntilLayoutComplete(
        getPinKeyboard, onLoaded);
    return;
  }

  // Register loader for custom elements.
  cr.ui.login.ResourceLoader.registerAssets({
    id: 'custom-elements',
    html: [{url: 'chrome://oobe/custom_elements.html'}]
  });

  // We only load the PIN element when it is actually shown so that lock screen
  // load times remain low when the user is not using a PIN.
  //
  // Loading the PIN element blocks the DOM, which will interrupt any running
  // animations. We load the PIN after an idle notification to allow the pod
  // fly-in animation to complete without interruption.
  cr.ui.login.ResourceLoader.loadAssetsOnIdle('custom-elements', function() {
    cr.ui.login.ResourceLoader.waitUntilLayoutComplete(
        getPinKeyboard, onLoaded);
  });
}
/**
 * Ensures that the pin keyboard is loaded.
 * @param {function()} onLoaded Callback run when the pin keyboard is loaded.
 */
Ensures that the pin keyboard is loaded.
@param {function()} onLoaded Callback run when the pin keyboard is loaded.
Ensures that the pin keyboard is loaded . @param { function () } onLoaded Callback run when the pin keyboard is loaded .
function ensurePinKeyboardLoaded(onLoaded) {
  'use strict';
  var getPinKeyboard = function() {
    return $('pod-row').querySelectorAll('pin-keyboard')[0];
  };
  if (cr.ui.login.ResourceLoader.hasDeferredAssets('custom-elements')) {
    cr.ui.login.ResourceLoader.waitUntilLayoutComplete(
        getPinKeyboard, onLoaded);
    return;
  }
  cr.ui.login.ResourceLoader.registerAssets({
    id: 'custom-elements',
    html: [{url: 'chrome:oobe/custom_elements.html'}]
  });
   Loading the PIN element blocks the DOM, which will interrupt any running
   animations. We load the PIN after an idle notification to allow the pod
   fly-in animation to complete without interruption.
  cr.ui.login.ResourceLoader.loadAssetsOnIdle('custom-elements', function() {
    cr.ui.login.ResourceLoader.waitUntilLayoutComplete(
        getPinKeyboard, onLoaded);
  });
}
function ensurePinKeyboardLoaded ( onLoaded ) { 'use strict' ; var getPinKeyboard = function ( ) { return $ ( 'pod-row' ) . querySelectorAll ( 'pin-keyboard' ) [ 0 ] ; } ; if ( cr . ui . login . ResourceLoader . hasDeferredAssets ( 'custom-elements' ) ) { cr . ui . login . ResourceLoader . waitUntilLayoutComplete ( getPinKeyboard , onLoaded ) ; return ; } cr . ui . login . ResourceLoader . registerAssets ( { id : 'custom-elements' , html : [ { url : 'chrome://oobe/custom_elements.html' } ] } ) ; cr . ui . login . ResourceLoader . loadAssetsOnIdle ( 'custom-elements' , function ( ) { cr . ui . login . ResourceLoader . waitUntilLayoutComplete ( getPinKeyboard , onLoaded ) ; } ) ; }
Ensures that the pin keyboard is loaded.
Ensures that the pin keyboard is loaded .
// The element we want to see if loaded. // Do not reload assets if they are already loaded. Run |onLoaded| once assets // are done loading, though. // Register loader for custom elements. // We only load the PIN element when it is actually shown so that lock screen // load times remain low when the user is not using a PIN. // // Loading the PIN element blocks the DOM, which will interrupt any running // animations. We load the PIN after an idle notification to allow the pod // fly-in animation to complete without interruption.