Monotone Arbeit nervt!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

35 lines
1.0 KiB

1 year ago
  1. // on clicking Previous button in browser, reset the page
  2. // needed to get another CSRF token and remove the spinning wheel
  3. window.onpageshow = function() {
  4. if (performance.getEntriesByType("navigation")[0].type == "back_forward") {
  5. location.reload(false);
  6. }
  7. }
  8. let browse_forms_button = get('browse_forms_button');
  9. let new_link_button = get('new_link_button');
  10. // csrf_token is retrieved from server-side template
  11. new_link_button.addEventListener('click', function() {
  12. get("new_link").submit();
  13. hideButtonsAndSpin();
  14. });
  15. if (browse_forms_button != undefined) {
  16. browse_forms_button.addEventListener('click', function () {
  17. hideButtonsAndSpin();
  18. });
  19. }
  20. function hideButtonsAndSpin() {
  21. new_link_button.classList.add("hidden");
  22. // hide the access forms button if it exists
  23. if (browse_forms_button != undefined) {
  24. browse_forms_button.classList.add("hidden");
  25. }
  26. get('loading_ring').classList.remove("hidden");
  27. }
  28. function get(elemId) {
  29. return document.getElementById(elemId);
  30. }