diff options
author | M Somerville <matthew-github@dracos.co.uk> | 2020-10-23 10:31:52 +0100 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-11-02 04:05:34 +0000 |
commit | e37e3af3656b4545e638494c3ada61e37df7ee0a (patch) | |
tree | 04cb8d92236cb3ab868b78e88d9386ca65cd8528 /web/cobrands/borsetshire/js.js | |
parent | 4b5252e0671cb9636b141009ea27daebf9f70c42 (diff) |
[Borsetshire] Move sign-in button code inline.
This should fix a race condition on Travis where the button is clicked
before the JavaScript on the button has registered.
Diffstat (limited to 'web/cobrands/borsetshire/js.js')
-rw-r--r-- | web/cobrands/borsetshire/js.js | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/web/cobrands/borsetshire/js.js b/web/cobrands/borsetshire/js.js index 2888a9548..6c0da398e 100644 --- a/web/cobrands/borsetshire/js.js +++ b/web/cobrands/borsetshire/js.js @@ -4,27 +4,8 @@ return; } - function set_redirect(form) { - var e = form.username.value; - if (e == 'inspector@example.org') { - form.r.value = 'my/planned'; - } else if (e == 'cs@example.org') { - form.r.value = 'reports'; - } else if (e == 'super@example.org') { - form.r.value = 'admin'; - } - } - - $('#demo-user-list button').click(function(){ - var form = document.forms.general_auth; - form.username.value = $(this).data('email'); - form.password_sign_in.value = 'password'; - set_redirect(form); - form.submit(); - }); - $('form[name=general_auth]').on('submit', function() { - set_redirect(this); + fixmystreet.borsetshire.set_redirect(this); }); })(); |