From b829be29b6125de5f6663d7c05daefc57ed4f663 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 28 Apr 2016 17:13:02 +0200 Subject: [PATCH] Lazy load Google and Persona login stuff --- src/root/auth.tt | 66 ++++++++++++++++++++++++++++++---------------- src/root/layout.tt | 1 - src/root/topbar.tt | 15 ++++------- 3 files changed, 48 insertions(+), 34 deletions(-) diff --git a/src/root/auth.tt b/src/root/auth.tt index 32e8ec58..4374daba 100644 --- a/src/root/auth.tt +++ b/src/root/auth.tt @@ -1,5 +1,13 @@ [% IF c.user_exists %] + [% IF c.user.type == 'google' %] + + [% END %] + + [% IF c.user.type == 'persona' %] + + [% END %] + [% IF c.config.enable_google_login %] @@ -79,30 +96,33 @@ } }); return false; - }; + }; + + $("#google-signin").click(function() { + $(".g-signin2:first-child > div").click(); + }); + + [% END %] + + [% IF c.config.enable_persona %] + [% END %] [% END %] - -[% IF c.config.enable_persona %] - - - -[% END %] diff --git a/src/root/layout.tt b/src/root/layout.tt index 01424f90..d16043de 100644 --- a/src/root/layout.tt +++ b/src/root/layout.tt @@ -43,7 +43,6 @@ [% IF c.config.enable_google_login %] - [% END %] [% tracker %] diff --git a/src/root/topbar.tt b/src/root/topbar.tt index 54051fa8..0503d15c 100644 --- a/src/root/topbar.tt +++ b/src/root/topbar.tt @@ -1,5 +1,5 @@ [% BLOCK makeSubMenu %] -