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.

30 lines
1.1KB

  1. /*
  2. # @name: main.js
  3. # @version: 0.1
  4. # @creation_date: 2022-04-07
  5. # @license: The MIT License <https://opensource.org/licenses/MIT>
  6. # @author: Simon Bowie <ad7588@coventry.ac.uk>
  7. # @purpose: JavaScript functions for various functions
  8. # @acknowledgements:
  9. # https://stackoverflow.com/questions/67942546/bootstrap-5-select-dropdown-with-the-multiple-attribute-collapsed
  10. */
  11. // Dynamic HTML forms based on dropdown menu
  12. $("#resource_type").change(function() {
  13. var $ = jQuery.noConflict();
  14. var resource_type = $(this).val();
  15. $(".resource_type_input").hide("fast", function() {
  16. $("#resource_type_" + resource_type).show("slow");
  17. });
  18. });
  19. // Testing a couple of ways to expand text
  20. var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
  21. var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
  22. return new bootstrap.Tooltip(tooltipTriggerEl)
  23. })
  24. var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'))
  25. var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
  26. return new bootstrap.Popover(popoverTriggerEl)
  27. })