Proyectos de Subversion Moodle

Rev

Autoría | Ultima modificación | Ver Log |

define("tool_monitor/dropdown",["exports"],(function(_exports){Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=void 0;_exports.init=()=>{const componentSelector=document.querySelector('[data-field="component"]'),eventSelector=document.querySelector('[data-field="eventname"]'),matchesComponent=(component,event)=>event.startsWith("\\".concat(component,"\\")),getEventOptionsForComponent=component=>(component=>Object.entries(JSON.parse(eventSelector.dataset.eventlist)).filter(((_ref,index)=>{let[eventName]=_ref;return 0===index||matchesComponent(component,eventName)})))(component).map((_ref2=>{let[name,description]=_ref2;const option=document.createElement("option");return option.value=name,option.text=description,option}));componentSelector.addEventListener("change",(()=>{eventSelector.innerHTML="",getEventOptionsForComponent(componentSelector.value).forEach((option=>{eventSelector.options.add(option)})),eventSelector.options.value=""}));const initialCount=eventSelector.options.length;[...eventSelector.options].reverse().forEach(((option,index)=>{""!==option.value&&(matchesComponent(componentSelector.value,option.value)||eventSelector.options.remove(initialCount-index-1))}))}}));

//# sourceMappingURL=dropdown.min.js.map