MDL-54721 report_competency: Do not ignore the first user selection

This commit is contained in:
Frederic Massart 2016-05-26 17:52:34 +08:00
parent 6a74e76fb8
commit 6e91817178
4 changed files with 2 additions and 12 deletions

View File

@ -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});
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});

View File

@ -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;

View File

@ -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});
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});

View File

@ -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;