Proyectos de Subversion Moodle

Rev

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

/**
 * @author     Andreas Grabs <moodle@grabs-edv.de>
 * @copyright  2024 Andreas Grabs
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
define("mod_unilabel/contentloader",["jquery","core/fragment","core/templates","core/notification"],(function($,fragment,templates,notification){var ContentLoader=function(contentcontainerselector,fragmentcall,serviceparams,contextid){this.contentcontainerselector=contentcontainerselector,this.fragmentcall=fragmentcall,this.serviceparams=void 0===serviceparams?{}:serviceparams,this.contextid=contextid,this.isshown=!1};return ContentLoader.prototype.loadContent=function(adjacentPosition){var _this=this;if(void 0===_this.disablespinner){$(_this.contentcontainerselector).html("");$(_this.contentcontainerselector).prepend('<div class="text-center" id="myspinner"><i class="fa fa-spinner fa-2x fa-spin"></i></div>')}return fragment.loadFragment("mod_unilabel",_this.fragmentcall,_this.contextid,_this.serviceparams).then((function(html,js){return document.querySelector(_this.contentcontainerselector).insertAdjacentHTML(adjacentPosition,html),js&&templates.runTemplateJS(js),_this.isshown=!0,$("#myspinner").remove(),!0})).fail(notification.exception)},ContentLoader.prototype.autoload=function(triggerselector,triggerevent,adjacentPosition){var _this=this;$(triggerselector).on(triggerevent,(function(){0==_this.isshown&&(_this.loadContent(adjacentPosition),_this.isshown=!0)}))},ContentLoader}));

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