Skip to content
Snippets Groups Projects
submission-tooltips.js 651 B
Newer Older
  • Learn to ignore specific revisions
  • (function ($) {
    
        'use strict';
    
        function generateTooltips() {
    
            // get the submisttions titles
            const titles = Array.prototype.slice.call(document.querySelectorAll('.js-title'));
    
            // if the tile has been truncated...
    
            titles.forEach(function (title) {
    
                if (title.textContent.indexOf('...') >= 0) {
                    addToolTip(title);
                }
            });
    
            // ...add a tooltip class
            function addToolTip(title) {
                title.classList.add('has-tooltip');
            }
        }
    
        // Add tooltips to truncated titles on submissions overview table
        generateTooltips();
    
    })(jQuery);