From 71c74427907a8ce3372127c38d7568bc813c0f3e Mon Sep 17 00:00:00 2001
From: Daniel Kesselberg
Date: Sat, 26 Oct 2019 23:08:52 +0200
Subject: [PATCH] The loading animation is back
Refactor grant.js to Vanilla JS
Remove id="submit" because of side effects: https://stackoverflow.com/questions/22982741/form-submit-jquery-does-not-work
Fix arrow for login flow v1
Signed-off-by: Daniel Kesselberg
---
core/js/login/grant.js | 17 +++++++++--------
core/templates/loginflow/grant.php | 3 +--
core/templates/loginflowv2/grant.php | 3 ++-
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/core/js/login/grant.js b/core/js/login/grant.js
index c3c3371b17e..c8913f937bb 100644
--- a/core/js/login/grant.js
+++ b/core/js/login/grant.js
@@ -1,9 +1,10 @@
-jQuery(document).ready(function() {
- $('#submit').click(function (e) {
- $('#submit + .submit-icon')
- .removeClass('icon-confirm-white')
- .addClass(OCA.Theming && OCA.Theming.inverted
- ? 'icon-loading-small'
- : 'icon-loading-small-dark');
+document.querySelector('form').addEventListener('submit', function(e) {
+ const wrapper = document.getElementById('submit-wrapper')
+ if (wrapper === null) {
+ return
+ }
+ wrapper.getElementsByClassName('icon-confirm-white').forEach(function(el) {
+ el.classList.remove('icon-confirm-white')
+ el.classList.add(OCA.Theming && OCA.Theming.inverted ? 'icon-loading-small' : 'icon-loading-small-dark')
})
-})
\ No newline at end of file
+})
diff --git a/core/templates/loginflow/grant.php b/core/templates/loginflow/grant.php
index 017bb1f23cf..2321d3714f3 100644
--- a/core/templates/loginflow/grant.php
+++ b/core/templates/loginflow/grant.php
@@ -45,8 +45,7 @@ $urlGenerator = $_['urlGenerator'];
diff --git a/core/templates/loginflowv2/grant.php b/core/templates/loginflowv2/grant.php
index 6164fab6bcf..c8ea22dca8b 100644
--- a/core/templates/loginflowv2/grant.php
+++ b/core/templates/loginflowv2/grant.php
@@ -19,6 +19,7 @@
*
*/
+script('core', 'login/grant');
style('core', 'login/authpicker');
/** @var array $_ */
@@ -42,7 +43,7 @@ $urlGenerator = $_['urlGenerator'];
-
+
--
2.39.5