Merge branch 'MDL-66158-master' of git://github.com/andrewnicols/moodle

This commit is contained in:
Jake Dallimore 2019-07-16 10:30:52 +08:00
commit e83765bcf1
2 changed files with 2 additions and 2 deletions

View File

@ -1 +1 @@
define(["jquery","core/notification","core_calendar/selectors","core_calendar/events","core/templates","core_calendar/view_manager"],function(a,b,c,d,e,f){var g=function(e){var g=a("body");g.on([d.monthChanged,d.dayChanged],function(a,c,d,f,g){e.queue(function(e){return h(a,c,d,f,g).then(function(){return e()}).fail(b.exception)})});var h=function(b,d,g,h,i){var j=e.find('[data-year="'+d+'"][data-month="'+g+'"]'),k=j.closest(c.calendarPeriods.month),l=e.find(c.calendarPeriods.month),m=a(l[0]),n=a(l[2]),o=a("<span>");o.attr("data-template","core_calendar/threemonth_month"),o.attr("data-includenavigation",!1),o.attr("data-mini",!0);var p=a("<div>");p.hide(),p.append(o);var q,r,s;return k.is(m)?(p.insertBefore(m),q=m.data("previousYear"),r=m.data("previousMonth"),s=n):k.is(n)&&(p.insertAfter(n),q=n.data("nextYear"),r=n.data("nextMonth"),s=m),f.refreshMonthContent(o,q,r,h,i,o).then(function(){var b=a.Deferred(),c=a.Deferred();return s.slideUp("fast",function(){a(this).remove(),b.resolve()}),p.slideDown("fast",function(){c.resolve()}),a.when(b,c)})};e.on("click",c.links.miniDayLink,function(b){var d=a(b.target),e=d.data("year"),g=d.data("month"),h=d.text(),i=d.data("courseid"),j=d.data("categoryid"),k=a("body").find(c.calendarMain);f.refreshDayContent(k,e,g,h,i,j,k,"core_calendar/calendar_day"),b.preventDefault(),window.history.pushState({},"","?view=day")})};return{init:function(b){b=a(b),g(b)}}});
define(["jquery","core/notification","core_calendar/selectors","core_calendar/events","core/templates","core_calendar/view_manager"],function(a,b,c,d,e,f){var g=function(e){var g=a("body");g.on([d.monthChanged,d.dayChanged].join(" "),function(a,c,d,f,g){e.queue(function(e){return h(a,c,d,f,g).then(function(){return e()}).fail(b.exception)})});var h=function(b,d,g,h,i){var j=e.find('[data-year="'+d+'"][data-month="'+g+'"]'),k=j.closest(c.calendarPeriods.month),l=e.find(c.calendarPeriods.month),m=a(l[0]),n=a(l[2]),o=a("<span>");o.attr("data-template","core_calendar/threemonth_month"),o.attr("data-includenavigation",!1),o.attr("data-mini",!0);var p=a("<div>");p.hide(),p.append(o);var q,r,s;return k.is(m)?(p.insertBefore(m),q=m.data("previousYear"),r=m.data("previousMonth"),s=n):k.is(n)&&(p.insertAfter(n),q=n.data("nextYear"),r=n.data("nextMonth"),s=m),f.refreshMonthContent(o,q,r,h,i,o).then(function(){var b=a.Deferred(),c=a.Deferred();return s.slideUp("fast",function(){a(this).remove(),b.resolve()}),p.slideDown("fast",function(){c.resolve()}),a.when(b,c)})};e.on("click",c.links.miniDayLink,function(b){var d=a(b.target),e=d.data("year"),g=d.data("month"),h=d.text(),i=d.data("courseid"),j=d.data("categoryid"),k=a("body").find(c.calendarMain);f.refreshDayContent(k,e,g,h,i,j,k,"core_calendar/calendar_day"),b.preventDefault(),window.history.pushState({},"","?view=day")})};return{init:function(b){b=a(b),g(b)}}});

View File

@ -47,7 +47,7 @@ function(
*/
var registerCalendarEventListeners = function(root) {
var body = $('body');
body.on([CalendarEvents.monthChanged, CalendarEvents.dayChanged], function(e, year, month, courseId, categoryId) {
body.on([CalendarEvents.monthChanged, CalendarEvents.dayChanged].join(' '), function(e, year, month, courseId, categoryId) {
// We have to use a queue here because the calling code is decoupled from these listeners.
// It's possible for the event to be called multiple times before one call is fully resolved.
root.queue(function(next) {