From 6e918171788a0fd728a8bdea54c57a49ac02736c Mon Sep 17 00:00:00 2001 From: Frederic Massart Date: Thu, 26 May 2016 17:52:34 +0800 Subject: [PATCH] MDL-54721 report_competency: Do not ignore the first user selection --- .../lp/amd/build/user_competency_course_navigation.min.js | 2 +- .../tool/lp/amd/src/user_competency_course_navigation.js | 2 -- report/competency/amd/build/user_course_navigation.min.js | 2 +- report/competency/amd/src/user_course_navigation.js | 8 -------- 4 files changed, 2 insertions(+), 12 deletions(-) diff --git a/admin/tool/lp/amd/build/user_competency_course_navigation.min.js b/admin/tool/lp/amd/build/user_competency_course_navigation.min.js index e11b466851a..674172ff27b 100644 --- a/admin/tool/lp/amd/build/user_competency_course_navigation.min.js +++ b/admin/tool/lp/amd/build/user_competency_course_navigation.min.js @@ -1 +1 @@ -define(["jquery"],function(a){var b=function(b,c,d,e,f,g){this._baseUrl=d,this._userId=e+"",this._competencyId=f+"",this._courseId=g,a(b).on("change",this._userChanged.bind(this)),a(c).on("change",this._competencyChanged.bind(this))};return b.prototype._userChanged=function(b){var c=a(b.target).val(),d="?userid="+c+"&courseid="+this._courseId+"&competencyid="+this._competencyId;document.location=this._baseUrl+d},b.prototype._competencyChanged=function(b){var c=a(b.target).val(),d="?userid="+this._userId+"&courseid="+this._courseId+"&competencyid="+c;document.location=this._baseUrl+d},b.prototype._competencyId=null,b.prototype._userId=null,b.prototype._courseId=null,b.prototype._baseUrl=null,b.prototype._ignoreFirstUser=null,b.prototype._ignoreFirstCompetency=null,b}); \ No newline at end of file +define(["jquery"],function(a){var b=function(b,c,d,e,f,g){this._baseUrl=d,this._userId=e+"",this._competencyId=f+"",this._courseId=g,a(b).on("change",this._userChanged.bind(this)),a(c).on("change",this._competencyChanged.bind(this))};return b.prototype._userChanged=function(b){var c=a(b.target).val(),d="?userid="+c+"&courseid="+this._courseId+"&competencyid="+this._competencyId;document.location=this._baseUrl+d},b.prototype._competencyChanged=function(b){var c=a(b.target).val(),d="?userid="+this._userId+"&courseid="+this._courseId+"&competencyid="+c;document.location=this._baseUrl+d},b.prototype._competencyId=null,b.prototype._userId=null,b.prototype._courseId=null,b.prototype._baseUrl=null,b.prototype._ignoreFirstCompetency=null,b}); \ No newline at end of file diff --git a/admin/tool/lp/amd/src/user_competency_course_navigation.js b/admin/tool/lp/amd/src/user_competency_course_navigation.js index a7a43ba5c0e..bf61fe5ddb0 100644 --- a/admin/tool/lp/amd/src/user_competency_course_navigation.js +++ b/admin/tool/lp/amd/src/user_competency_course_navigation.js @@ -75,8 +75,6 @@ define(['jquery'], function($) { UserCompetencyCourseNavigation.prototype._courseId = null; /** @type {String} Plugin base url. */ UserCompetencyCourseNavigation.prototype._baseUrl = null; - /** @type {Boolean} Ignore the first change event for users. */ - UserCompetencyCourseNavigation.prototype._ignoreFirstUser = null; /** @type {Boolean} Ignore the first change event for competencies. */ UserCompetencyCourseNavigation.prototype._ignoreFirstCompetency = null; diff --git a/report/competency/amd/build/user_course_navigation.min.js b/report/competency/amd/build/user_course_navigation.min.js index 5cfef53bbfe..fe73037f2b5 100644 --- a/report/competency/amd/build/user_course_navigation.min.js +++ b/report/competency/amd/build/user_course_navigation.min.js @@ -1 +1 @@ -define(["jquery"],function(a){var b=function(b,c,d,e){this._baseUrl=c,this._userId=d+"",this._courseId=e,this._ignoreFirstUser=!0,a(b).on("change",this._userChanged.bind(this))};return b.prototype._userChanged=function(b){if(this._ignoreFirstUser)return void(this._ignoreFirstUser=!1);var c=a(b.target).val(),d="?user="+c+"&id="+this._courseId;document.location=this._baseUrl+d},b.prototype._userId=null,b.prototype._courseId=null,b.prototype._baseUrl=null,b.prototype._ignoreFirstUser=null,b}); \ No newline at end of file +define(["jquery"],function(a){var b=function(b,c,d,e){this._baseUrl=c,this._userId=d+"",this._courseId=e,a(b).on("change",this._userChanged.bind(this))};return b.prototype._userChanged=function(b){var c=a(b.target).val(),d="?user="+c+"&id="+this._courseId;document.location=this._baseUrl+d},b.prototype._userId=null,b.prototype._courseId=null,b.prototype._baseUrl=null,b}); \ No newline at end of file diff --git a/report/competency/amd/src/user_course_navigation.js b/report/competency/amd/src/user_course_navigation.js index 07a1595096b..c5bf1bfb736 100644 --- a/report/competency/amd/src/user_course_navigation.js +++ b/report/competency/amd/src/user_course_navigation.js @@ -35,7 +35,6 @@ define(['jquery'], function($) { this._baseUrl = baseUrl; this._userId = userId + ''; this._courseId = courseId; - this._ignoreFirstUser = true; $(userSelector).on('change', this._userChanged.bind(this)); }; @@ -47,11 +46,6 @@ define(['jquery'], function($) { * @param {Event} e */ UserCourseNavigation.prototype._userChanged = function(e) { - if (this._ignoreFirstUser) { - this._ignoreFirstUser = false; - return; - } - var newUserId = $(e.target).val(); var queryStr = '?user=' + newUserId + '&id=' + this._courseId; document.location = this._baseUrl + queryStr; @@ -63,8 +57,6 @@ define(['jquery'], function($) { UserCourseNavigation.prototype._courseId = null; /** @type {String} Plugin base url. */ UserCourseNavigation.prototype._baseUrl = null; - /** @type {Boolean} Ignore the first change event for users. */ - UserCourseNavigation.prototype._ignoreFirstUser = null; return /** @alias module:report_competency/user_course_navigation */ UserCourseNavigation;