@@ -396,10 +396,7 @@ popup is blocked by the browser, it will fall back to a full page redirect.
396
396
397
397
### Available callbacks
398
398
399
- Currently only one callback is supported. Some will be added soon to monitor UI
400
- changes.
401
-
402
- ` signInSuccess(currentUser, credential, redirectUrl) `
399
+ #### ` signInSuccess(currentUser, credential, redirectUrl) `
403
400
404
401
** Parameters:**
405
402
@@ -423,6 +420,12 @@ static `signInSuccessUrl` in config.
423
420
If the callback returns ` false ` or nothing, the page is not automatically
424
421
redirected.
425
422
423
+ #### ` uiShown() `
424
+
425
+ This callback is triggered the first time the widget UI is rendered. This is
426
+ useful for cases where the application should display a custom loader before
427
+ FirebaseUI is displayed.
428
+
426
429
### Example with all parameters used
427
430
428
431
``` html
@@ -446,6 +449,11 @@ redirected.
446
449
// Return type determines whether we continue the redirect automatically
447
450
// or whether we leave that to developer to handle.
448
451
return true ;
452
+ },
453
+ uiShown : function () {
454
+ // The widget is rendered.
455
+ // Hide the loader.
456
+ document .getElementById (' loader' ).style .display = ' none' ;
449
457
}
450
458
},
451
459
credentialHelper: firebaseui .auth .CredentialHelper .ACCOUNT_CHOOSER_COM ,
@@ -477,6 +485,7 @@ redirected.
477
485
Your app may use that space for branding, controls and other customizations.-->
478
486
<h1 >Welcome to My Awesome App</h1 >
479
487
<div id =" firebaseui-auth-container" ></div >
488
+ <div id =" loader" >Loading...</div >
480
489
</body >
481
490
</html >
482
491
```
0 commit comments