menubar spin: stop after 10 seconds
authorMathieu Lu <mathieu@symbiotic.coop>
Wed, 20 Dec 2023 20:04:08 +0000 (15:04 -0500)
committerMathieu Lutfy <mathieu@bidon.ca>
Wed, 20 Dec 2023 20:04:08 +0000 (15:04 -0500)
js/crm.menubar.js

index 3ec193832fbfcb4fb36f5a0d8f129526c0517fc1..357331f382fc8d2c720025de70791bf2d2307abd 100644 (file)
     },
     spin: function(spin) {
       $('.crm-logo-sm', '#civicrm-menu').toggleClass('fa-spin', spin);
+      // Sometimes the logo does not stop spinning (ex: file downloads)
+      if (spin) {
+        window.setTimeout(function() {
+          CRM.menubar.spin(false);
+        }, 10000);
+      }
     },
     getItem: function(itemName) {
       return traverse(CRM.menubar.data.menu, itemName, 'get');