MDL-63062 block_recentlyaccessedcourses: add block and styles
[moodle.git] / blocks / recentlyaccessedcourses / amd / build / main.min.js
... / ...
CommitLineData
1define(["jquery","core_course/repository","core/templates","core/notification"],function(a,b,c,d){var e={COURSES_VIEW:'[data-region="recentlyaccessedcourses-view"]',COURSES_VIEW_CONTENT:'[data-region="recentlyaccessedcourses-view-content"]'},f=10,g=function(a,c){return b.getLastAccessedCourses(a,c)},h=function(a,b){if(b.length>0)return c.render("block_recentlyaccessedcourses/view-cards",{courses:b});var d=a.attr("data-nocoursesimgurl");return c.render("block_recentlyaccessedcourses/no-courses",{nocoursesimgurl:d})},i=function(b,i){i=a(i);var j=i.find(e.COURSES_VIEW),k=i.find(e.COURSES_VIEW_CONTENT),l=g(b,f);l.then(function(a){var b=h(j,a);return b.then(function(a,b){return c.replaceNodeContents(k,a,b)})["catch"](d.exception),l})["catch"](d.exception)};return{init:i}});