]> source.dussan.org Git - nextcloud-server.git/commitdiff
The loading animation is back 17683/head
authorDaniel Kesselberg <mail@danielkesselberg.de>
Sat, 26 Oct 2019 21:08:52 +0000 (23:08 +0200)
committerDaniel Kesselberg <mail@danielkesselberg.de>
Sat, 26 Oct 2019 21:08:52 +0000 (23:08 +0200)
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 <mail@danielkesselberg.de>
core/js/login/grant.js
core/templates/loginflow/grant.php
core/templates/loginflowv2/grant.php

index c3c3371b17e8edec77492b3d5f79620054cbd379..c8913f937bb8309175167fea895a937fc06e6ca2 100644 (file)
@@ -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
+})
index 017bb1f23cf34f5c4e43d54af990cbb6c06bc9aa..2321d3714f342b176fc72c66932fc765a113923d 100644 (file)
@@ -45,8 +45,7 @@ $urlGenerator = $_['urlGenerator'];
                        <input type="hidden" name="stateToken" value="<?php p($_['stateToken']) ?>" />  
                        <input type="hidden" name="oauthState" value="<?php p($_['oauthState']) ?>" />  
                        <div id="submit-wrapper">
-                               <input type="submit" id="submit" class="login primary" title="" value="<?php p($l->t('Grant access')); ?>" />
-                               <div class="submit-icon icon-confirm-white"></div>
+                               <input type="submit" class="login primary icon-confirm-white" title="" value="<?php p($l->t('Grant access')); ?>" />
                        </div>  
                </form>
        </p>
index 6164fab6bcf0530950013ea7c032b4d79e371a9b..c8ea22dca8bf2b8fed942b9bb08d4900878421f0 100644 (file)
@@ -19,6 +19,7 @@
  *
  */
 
+script('core', 'login/grant');
 style('core', 'login/authpicker');
 
 /** @var array $_ */
@@ -42,7 +43,7 @@ $urlGenerator = $_['urlGenerator'];
                        <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" />
                        <input type="hidden" name="stateToken" value="<?php p($_['stateToken']) ?>" />  
                        <div id="submit-wrapper">
-                               <input type="submit" id="submit" class="login primary icon-confirm-white" title="" value="<?php p($l->t('Grant access')); ?>" />
+                               <input type="submit" class="login primary icon-confirm-white" title="" value="<?php p($l->t('Grant access')); ?>" />
                        </div>  
                </form>
        </p>