1/*1789981552000*/ 2/** 3 * [SIUAR-11738] 4 * Este script tiene como objetivo corregir un problema de posicionamiento del menú 5 * desplegable que aparece al hacer clic en el botón "Añadir" de un publicador de 6 * contenidos. El origen del problema es desconocido, y teniendo en cuenta que 7 * en un futuro se cambiará el tema y en los nuevos no pasa, se ha optado 8 * por una solución temporal que añade un evento que corrige el posicionamiento 9 * erróneo del menú. 10 * 11 * La implementación de esta solución garantiza que el botón de añadir 12 * se encuentre en el DOM antes de añadir el evento click. 13 */ 14(function() { 15 document.addEventListener('DOMContentLoaded', function() { 16 function addClickHandler() { 17 var $btn = $('.dropdown.lfr-icon-menu[data-qa-id="addButton"] .dropdown-toggle'); 18 if ($btn.length && !$btn.data('um-handler')) { 19 $btn.on('click', function () { 20 console.log('se ejecuta um-temp-fixes.js'); 21 const button = $(this); 22 const checkPopup = setInterval(function () { 23 const popup = $('.yui3-widget.overlay'); 24 if (popup.length > 0) { 25 clearInterval(checkPopup); 26 const buttonOffset = button.offset(); 27 const buttonWidth = button.outerWidth(); 28 const newLeft = buttonOffset.left + buttonWidth; 29 popup.css({ 30 left: newLeft + 'px', 31 top: buttonOffset.top + 'px', 32 position: 'absolute', 33 }).removeClass('overlay-hidden'); 34 } 35 }, 50); 36 }); 37 $btn.data('um-handler', true); 38 } 39 } 40 41 addClickHandler(); 42 43 var observer = new MutationObserver(addClickHandler); 44 observer.observe(document.body, {childList: true, subtree: true}); 45 }); 46})();
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.