Skip to content

Commit

Permalink
MDL-58493 enrol: Update JS to use font-awesome icon
Browse files Browse the repository at this point in the history
  • Loading branch information
Damyon Wiese committed Apr 11, 2017
1 parent bd99cb9 commit 473d849
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions enrol/yui/rolemanager/rolemanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,12 +301,18 @@ YUI.add('moodle-enrol-rolemanager', function(Y) {
addRoleToDisplay : function(roleId, roleTitle) {
var m = this.get(MANIPULATOR);
var container = this.get(CONTAINER);
var role = Y.Node.create('<div class="role role_'+roleId+'">'+roleTitle+'<a class="unassignrolelink"><img src="'+M.util.image_url('t/delete', 'moodle')+'" alt="" /></a></div>');
var link = role.one('.unassignrolelink');
link.roleId = roleId;
link.on('click', m.removeRole, m, this, link.roleId);
container.one('.col_role .roles').append(role);
this._toggleCurrentRole(link.roleId, true);
window.require(['core/templates'], function(Templates) {
Templates.renderPix('t/delete', 'core').then(function(pix) {
var role = Y.Node.create('<div class="role role_' + roleId + '">' +
roleTitle +
'<a class="unassignrolelink">' + pix + '</a></div>');
var link = role.one('.unassignrolelink');
link.roleId = roleId;
link.on('click', m.removeRole, m, this, link.roleId);
container.one('.col_role .roles').append(role);
this._toggleCurrentRole(link.roleId, true);
}.bind(this));
}.bind(this));
},
removeRoleFromDisplay : function(roleId) {
var container = this.get(CONTAINER);
Expand Down

0 comments on commit 473d849

Please sign in to comment.