From d48d1ba19a41d59dd02cf93e12be589ca5a866b1 Mon Sep 17 00:00:00 2001 From: Mark Nelson Date: Thu, 9 Nov 2017 14:08:24 +0800 Subject: [PATCH] MDL-60753 report_competency: fixed dialogue failing to show --- report/competency/amd/build/grading_popup.min.js | 2 +- report/competency/amd/src/grading_popup.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/report/competency/amd/build/grading_popup.min.js b/report/competency/amd/build/grading_popup.min.js index 280076e18e5..89e03396ec7 100644 --- a/report/competency/amd/build/grading_popup.min.js +++ b/report/competency/amd/build/grading_popup.min.js @@ -1 +1 @@ -define(["jquery","core/notification","core/str","core/ajax","core/log","core/templates","tool_lp/dialogue"],function(a,b,c,d,e,f,g){var h=function(b,c){this._regionSelector=b,this._userCompetencySelector=c,a(this._regionSelector).on("click",this._userCompetencySelector,this._handleClick.bind(this))};return h.prototype._handleClick=function(c){var f=a(c.target).closest(this._userCompetencySelector),g=a(f).data("competencyid"),h=a(f).data("courseid"),i=a(f).data("userid");e.debug("Clicked on cell: competencyId="+g+", courseId="+h+", userId="+i);var j=d.call([{methodname:"tool_lp_data_for_user_competency_summary_in_course",args:{userid:i,competencyid:g,courseid:h}},{methodname:"core_competency_user_competency_viewed_in_course",args:{userid:i,competencyid:g,courseid:h}}]);a.when.apply(a,j).then(function(){this._contextLoaded.bind(this)})["catch"](b.exception)},h.prototype._contextLoaded=function(a){var d=this;a.displayuser=!0,f.render("tool_lp/user_competency_summary_in_course",a).done(function(a,e){c.get_string("usercompetencysummary","report_competency").done(function(b){new g(b,a,f.runTemplateJS.bind(f,e),d._refresh.bind(d),(!0))}).fail(b.exception)}).fail(b.exception)},h.prototype._refresh=function(){var c=a(this._regionSelector),e=c.data("courseid"),f=c.data("userid");d.call([{methodname:"report_competency_data_for_report",args:{courseid:e,userid:f},done:this._pageContextLoaded.bind(this),fail:b.exception}])},h.prototype._pageContextLoaded=function(a){var c=this;f.render("report_competency/report",a).done(function(a,b){f.replaceNode(c._regionSelector,a,b)}).fail(b.exception)},h.prototype._regionSelector=null,h.prototype._userCompetencySelector=null,h}); \ No newline at end of file +define(["jquery","core/notification","core/str","core/ajax","core/log","core/templates","tool_lp/dialogue"],function(a,b,c,d,e,f,g){var h=function(b,c){this._regionSelector=b,this._userCompetencySelector=c,a(this._regionSelector).on("click",this._userCompetencySelector,this._handleClick.bind(this))};return h.prototype._handleClick=function(c){var f=a(c.target).closest(this._userCompetencySelector),g=a(f).data("competencyid"),h=a(f).data("courseid"),i=a(f).data("userid");e.debug("Clicked on cell: competencyId="+g+", courseId="+h+", userId="+i);var j=d.call([{methodname:"tool_lp_data_for_user_competency_summary_in_course",args:{userid:i,competencyid:g,courseid:h}},{methodname:"core_competency_user_competency_viewed_in_course",args:{userid:i,competencyid:g,courseid:h}}]);a.when.apply(a,j).then(function(a){this._contextLoaded.bind(this)(a)}.bind(this))["catch"](b.exception)},h.prototype._contextLoaded=function(a){var d=this;a.displayuser=!0,f.render("tool_lp/user_competency_summary_in_course",a).done(function(a,e){c.get_string("usercompetencysummary","report_competency").done(function(b){new g(b,a,f.runTemplateJS.bind(f,e),d._refresh.bind(d),(!0))}).fail(b.exception)}).fail(b.exception)},h.prototype._refresh=function(){var c=a(this._regionSelector),e=c.data("courseid"),f=c.data("userid");d.call([{methodname:"report_competency_data_for_report",args:{courseid:e,userid:f},done:this._pageContextLoaded.bind(this),fail:b.exception}])},h.prototype._pageContextLoaded=function(a){var c=this;f.render("report_competency/report",a).done(function(a,b){f.replaceNode(c._regionSelector,a,b)}).fail(b.exception)},h.prototype._regionSelector=null,h.prototype._userCompetencySelector=null,h}); \ No newline at end of file diff --git a/report/competency/amd/src/grading_popup.js b/report/competency/amd/src/grading_popup.js index 20d21605a03..f53b1235c79 100644 --- a/report/competency/amd/src/grading_popup.js +++ b/report/competency/amd/src/grading_popup.js @@ -59,10 +59,10 @@ define(['jquery', 'core/notification', 'core/str', 'core/ajax', 'core/log', 'cor args: {userid: userId, competencyid: competencyId, courseid: courseId}, }]); - $.when.apply($, requests).then(function() { - this._contextLoaded.bind(this); + $.when.apply($, requests).then(function(context) { + this._contextLoaded.bind(this)(context); return; - }).catch(notification.exception); + }.bind(this)).catch(notification.exception); }; /**