diff options
author | Byron Jones <bjones@mozilla.com> | 2013-03-27 05:41:29 +0100 |
---|---|---|
committer | Byron Jones <bjones@mozilla.com> | 2013-03-27 05:41:29 +0100 |
commit | 6c4fcb2bee2e1783d692011b58b42e5779385b15 (patch) | |
tree | 662f4a53fe1f7dd2f0348f1b2772ed2d22cbe78d | |
parent | a42b92556cc76c45fdc95b0caf903ad9b58fa2a8 (diff) | |
download | bugzilla-6c4fcb2bee2e1783d692011b58b42e5779385b15.tar.gz bugzilla-6c4fcb2bee2e1783d692011b58b42e5779385b15.tar.xz |
Bug 855128: defer loading of persona
-rw-r--r-- | extensions/Persona/template/en/default/hook/global/header-additional_header.html.tmpl | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/extensions/Persona/template/en/default/hook/global/header-additional_header.html.tmpl b/extensions/Persona/template/en/default/hook/global/header-additional_header.html.tmpl index 7eb1e69ec..a2f150373 100644 --- a/extensions/Persona/template/en/default/hook/global/header-additional_header.html.tmpl +++ b/extensions/Persona/template/en/default/hook/global/header-additional_header.html.tmpl @@ -17,7 +17,7 @@ [% USE Bugzilla %] [% cgi = Bugzilla.cgi %] -<script src="[% Param('persona_includejs_url') %]" type="text/javascript"></script> +<script defer src="[% Param('persona_includejs_url') %]" type="text/javascript"></script> <script type="text/javascript"> function createHidden(name, value, form) { @@ -62,17 +62,20 @@ function persona_onlogin(assertion) { [% END %] } -navigator.id.watch({ - [%# we can't set loggedInUser to user.login as this causes cgi authenticated - sessions to be logged out by persona %] - loggedInUser: null, - onlogin: persona_onlogin, - onlogout: function () { - [%# this should be redirecting to index.cgi?logout=1 however there's a - persona bug which causes this to break chrome and safari logins. - https://github.com/mozilla/browserid/issues/2423 %] - } -}); +YAHOO.util.Event.on(window, 'load', persona_init); +function persona_init() { + navigator.id.watch({ + [%# we can't set loggedInUser to user.login as this causes cgi authenticated + sessions to be logged out by persona %] + loggedInUser: null, + onlogin: persona_onlogin, + onlogout: function () { + [%# this should be redirecting to index.cgi?logout=1 however there's a + persona bug which causes this to break chrome and safari logins. + https://github.com/mozilla/browserid/issues/2423 %] + } + }); +} function persona_sign_in() { persona_ignore_login = false; |