1tippy.setDefaultProps({ 2 theme: 'form-helptext', 3 arrow: false, 4 placement: 'left-start', 5 animation: 'shift-toward', 6 interactive: true, 7 hideOnClick: false, 8 trigger: 'focus', 9 appendTo: 'parent', 10 maxWidth: 300, 11 allowHTML: true, 12 aria: { 13 content: 'describedby', 14 }, 15}) 16 17let isMobileDevice = window.matchMedia('only screen and (max-width: 991px)').matches; 18 19if (true === isMobileDevice) { 20 tippy.setDefaultProps({ 21 placement: 'top', 22 maxWidth: 'none', 23 popperOptions: { 24 strategy: 'fixed', 25 modifiers: [ 26 { 27 name: 'flip', 28 options: { 29 fallbackPlacements: ['top'] 30 } 31 } 32 ] 33 } 34 }); 35} 36 37tippy('.show-helptext', { 38 content(reference) { 39 const elementId = reference.getAttribute('data-template') 40 const linkedTemplate = document.getElementById(elementId) 41 42 if (!(linkedTemplate instanceof Object)) { 43 console.error('Tooltips: Could not find linked tooltip template with id: ' + elementId) 44 return; 45 } 46 47 linkedTemplate.innerHTML = '<span>' + linkedTemplate.innerHTML + '</span>'; 48 const template = appendReadMoreButtonToTemplate(linkedTemplate, elementId); 49 50 return template.innerHTML; 51 }, 52 onCreate(instance) { 53 const button = instance.popper.querySelector('[class^=toggle-more]'); 54 const tooltipContent = instance.popper.querySelector('.tippy-content') 55 56 if (!(button instanceof Object)) { 57 return; 58 } 59 button.addEventListener('click', () => { 60 tooltipContent.classList.toggle('isOpen'); 61 }); 62 }, 63}); 64
65function appendReadMoreButtonToTemplate(template, elementId) { 66 let button = document.createElement('button'); 67 let buttonText = document.createTextNode('Mehr Informationen'); 68 69 button.appendChild(buttonText); 70 button.className = 'toggle-more-' + elementId; 71 button.dataset.bsToggle = 'collapse'; 72 button.dataset.bsTarget = 'collapseOne'; 73 button.title = 'Mehr Informationen'; 74 75 template.innerHTML += button.outerHTML; 76 77 return template; 78}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.