moodle_local_treestudyplan/amd/build/page-invitemanager.min.js

3 lines
1.5 KiB
JavaScript
Raw Normal View History

2024-06-03 23:24:16 +02:00
define("local_treestudyplan/page-invitemanager",["exports","./util/debugger","core/str","core/modal_factory","core/modal_events"],(function(_exports,_debugger,_str,_modal_factory,_modal_events){function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj}}Object.defineProperty(_exports,"__esModule",{value:!0}),_exports.init=function(){getstrFunc([{key:"ok",component:"core"},{key:"confirm",component:"core"}]).then((s=>{const strOk=s[0],strConfirm=s[1];document.querySelectorAll(".path-local-treestudyplan a.m-action-confirm").forEach((el=>{el.addEventListener("click",(e=>{e.preventDefault();const link=e.currentTarget;let href=link.getAttribute("data-actionhref"),text=link.getAttribute("data-confirmtext"),oktext=link.getAttribute("data-confirmbtn");null==oktext&&(oktext=strOk);let title=link.getAttribute("data-confirmtitle");null==title&&(title=strConfirm),_modal_factory.default.create({type:_modal_factory.default.types.SAVE_CANCEL,title:title,body:text}).then((modal=>(modal.setSaveButtonText(oktext),modal.getRoot().on(_modal_events.default.save,(()=>{window.location=href})),modal.modal[0].style["max-width"]="345px",modal.show(),modal))).catch((x=>{debug.warn(x)}))}))}))})).catch((x=>{debug.warn(x)}))},_debugger=_interopRequireDefault(_debugger),_modal_factory=_interopRequireDefault(_modal_factory),_modal_events=_interopRequireDefault(_modal_events);const getstrFunc=void 0!==_str.getStrings?_str.getStrings:_str.get_strings;let debug=new _debugger.default("treestudyplan-invitemanager")}));
//# sourceMappingURL=page-invitemanager.min.js.map