self._selectedValue = $("input[type='radio']:checked").val();
self._find('[data-action="action-selector-confirm"]').removeAttr('disabled');
self._refresh.bind(self);
- }.bind(self));
+ });
// Add listener for cancel.
self._find('[data-action="action-selector-cancel"]').click(function(e) {
e.preventDefault();
self.close();
- }.bind(self));
+ });
// Add listener for confirm.
self._find('[data-action="action-selector-confirm"]').click(function(e) {
}
self._trigger('save', {action: self._selectedValue});
self.close();
- }.bind(self));
+ });
};
/**
html,
self._afterRender.bind(self)
);
- }.bind(self)).fail(Notification.exception);
+ }).fail(Notification.exception);
};
/**
return self._render().then(function(html) {
self._find('[data-region="action-selector"]').replaceWith(html);
self._afterRender();
- }.bind(self));
+ });
};
/**
templates.render('tool_lp/related_competencies', context).done(function(html) {
$('[data-region="relatedcompetencies"]').replaceWith(html);
updatedRelatedCompetencies();
- }.bind(this)).fail(notification.exception);
- }.bind(this)).fail(notification.exception);
+ }).fail(notification.exception);
+ }).fail(notification.exception);
};
/**
if (valid) {
validIds.push(compId);
}
- }.bind(self));
+ });
self._selectedCompetencies = validIds;
} else {
self._find('[data-region="competencylinktree"] [data-action="add"]').removeAttr('disabled');
}
- }.bind(self));
+ });
// Add listener for framework change.
if (!self._singleFramework) {
self._find('[data-action="chooseframework"]').change(function(e) {
self._frameworkId = $(e.target).val();
self._loadCompetencies().then(self._refresh.bind(self));
- }.bind(self));
+ });
}
// Add listener for search.
return self._refresh().always(function() {
$(e.target).removeAttr('disabled');
});
- }.bind(self));
+ });
// Add listener for cancel.
self._find('[data-region="competencylinktree"] [data-action="cancel"]').click(function(e) {
e.preventDefault();
self.close();
- }.bind(self));
+ });
// Add listener for add.
self._find('[data-region="competencylinktree"] [data-action="add"]').click(function(e) {
}
self.close();
- }.bind(self));
+ });
// The list of selected competencies will be modified while looping (because of the listeners above).
var currentItems = self._selectedCompetencies.slice(0);
tree.toggleItem(node);
tree.updateFocus(node);
}
- }.bind(self));
+ });
};
html,
self._afterRender.bind(self)
);
- }.bind(self));
- }.bind(self)).fail(Notification.exception);
+ });
+ }).fail(Notification.exception);
};
/**
self._competencies = tree;
- }.bind(self)).fail(Notification.exception);
+ }).fail(Notification.exception);
};
/**
}
return self._loadCompetencies();
- }.bind(self));
+ });
};
/**
return self._render().then(function(html) {
self._find('[data-region="competencylinktree"]').replaceWith(html);
self._afterRender();
- }.bind(self));
+ });
};
/**
};
return Templates.render('tool_lp/competency_picker', context);
- }.bind(self));
+ });
};
/**
self._find('[data-action="chooseplan"]').change(function(e) {
self._planId = $(e.target).val();
self._loadCompetencies().then(self._refresh.bind(self));
- }.bind(self));
+ });
}
};
}
return self._loadCompetencies();
- }.bind(self));
+ });
};
/**
};
return Templates.render('tool_lp/competency_picker_user_plans', context);
- }.bind(self));
+ });
};
return /** @alias module:tool_lp/competencypicker_user_plans */ Picker;
args: args,
done: function(evidence) {
self._trigger('competencyupdated', {args: args, evidence: evidence});
- }.bind(self),
+ },
fail: notification.exception
}]);
- }.bind(self));
+ });
}).fail(notification.exception);
};
};
return Templates.render('tool_lp/competency_picker_competencyform', context);
- }.bind(self));
+ });
};
// On selected competency.
picker.on('save', function(e, data) {
self.setParent(data);
- }.bind(self));
+ });
picker.display();
});
.done(function(newhtml, newjs) {
$(self._region).replaceWith(newhtml);
templates.runTemplateJS(newjs);
- }.bind(self))
+ })
.fail(notification.exception);
};
strings[3], // Cancel.
function() {
self._doDelete(planData);
- }.bind(self)
+ }
);
}).fail(notification.exception);
}).fail(notification.exception);
strings[3], // Cancel.
function() {
self._doReopenPlan(planData);
- }.bind(self)
+ }
);
}).fail(notification.exception);
}).fail(notification.exception);
strings[3], // Cancel.
function() {
self._doCompletePlan(planData);
- }.bind(self)
+ }
);
}).fail(notification.exception);
}).fail(notification.exception);
strings[3], // Cancel.
function() {
self._doUnlinkPlan(planData);
- }.bind(self)
+ }
);
}).fail(notification.exception);
}).fail(notification.exception);
}.bind(this));
body.on('click', '[data-action="cancel"]', function() {
popup.close();
- }.bind(this));
+ });
};
/**
templates.render(self._template, context)
.done(function(newhtml, newjs) {
templates.replaceNode($(self._region), newhtml, newjs);
- }.bind(self))
+ })
.fail(notification.exception);
};
strings[3], // Cancel.
function() {
self._doDelete(evidenceData);
- }.bind(self)
+ }
);
}).fail(notification.exception);
}).fail(notification.exception);
picker.on('save', function(e, data) {
var competencyIds = data.competencyIds;
self._doCreateUserEvidenceCompetency(evidenceData, competencyIds, data.requestReview);
- }.bind(self));
+ });
picker.display();
};
strings[3], // Cancel.
function() {
self._doReviewUserEvidenceCompetencies(evidenceData);
- }.bind(self)
+ }
);
}).fail(notification.exception);
}).fail(notification.exception);
allScript += ' ' + scriptNode.text();
}
}
- }.bind(this));
+ });
promise.resolve(data.html, allScript);
}).fail(function(ex) {
promise.reject(ex);
str.get_string('changeuser', 'mod_assign').done(function(s) {
autocomplete.enhance('[data-action=change-user]', false, 'mod_assign/participant_selector', s);
- }.bind(this)
+ }
).fail(notification.exception);
// We do not allow navigation while ajax requests are pending.
if ($(ele).prop('checked')) {
filterlist[filterlist.length] = $(ele).closest('label').text();
}
- }.bind(this));
+ });
if (filterlist.length) {
this._region.find('[data-region="user-filters"] span').text(filterlist.join(', '));
} else {
show = false;
}
}
- }.bind(this));
+ });
if (show) {
this._filteredUsers[this._filteredUsers.length] = user;
notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {
$(document).trigger('save-changes', -1);
});
- }.bind(this));
+ });
} else {
$(document).trigger('user-changed', -1);
}
notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {
$(document).trigger('save-changes', useridnumber);
});
- }.bind(this));
+ });
} else {
select.attr('data-selected', userid);
notification.confirm(strs[0], strs[1], strs[2], strs[3], function() {
$(document).trigger('save-changes', userid);
});
- }.bind(this));
+ });
} else {
if (!isNaN(userid) && userid > 0) {
select.attr('data-selected', userid);