Skip to content

Commit

Permalink
MDL-58796 mod_quiz: add handling for fontawesome icons
Browse files Browse the repository at this point in the history
  • Loading branch information
lameze committed May 4, 2017
1 parent 932bc91 commit 84d4411
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -420,13 +420,23 @@ Y.Moodle.mod_quiz.util.slot = {
if (requiresprevious) {
link.set('title', M.util.get_string('questiondependencyremove', 'quiz', a));
link.setData('action', 'removedependency');
icon.set('alt', M.util.get_string('questiondependsonprevious', 'quiz'));
icon.set('src', M.util.image_url('t/locked', 'moodle'));
window.require(['core/templates'], function(Templates) {
Templates.renderPix('t/locked', 'core', M.util.get_string('questiondependsonprevious', 'quiz')).then(
function(html) {
icon.replace(html);
}
);
});
} else {
link.set('title', M.util.get_string('questiondependencyadd', 'quiz', a));
link.setData('action', 'adddependency');
icon.set('alt', M.util.get_string('questiondependencyfree', 'quiz'));
icon.set('src', M.util.image_url('t/unlocked', 'moodle'));
window.require(['core/templates'], function(Templates) {
Templates.renderPix('t/unlocked', 'core', M.util.get_string('questiondependencyfree', 'quiz')).then(
function(html) {
icon.replace(html);
}
);
});
}
}
};
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -420,13 +420,23 @@ Y.Moodle.mod_quiz.util.slot = {
if (requiresprevious) {
link.set('title', M.util.get_string('questiondependencyremove', 'quiz', a));
link.setData('action', 'removedependency');
icon.set('alt', M.util.get_string('questiondependsonprevious', 'quiz'));
icon.set('src', M.util.image_url('t/locked', 'moodle'));
window.require(['core/templates'], function(Templates) {
Templates.renderPix('t/locked', 'core', M.util.get_string('questiondependsonprevious', 'quiz')).then(
function(html) {
icon.replace(html);
}
);
});
} else {
link.set('title', M.util.get_string('questiondependencyadd', 'quiz', a));
link.setData('action', 'adddependency');
icon.set('alt', M.util.get_string('questiondependencyfree', 'quiz'));
icon.set('src', M.util.image_url('t/unlocked', 'moodle'));
window.require(['core/templates'], function(Templates) {
Templates.renderPix('t/unlocked', 'core', M.util.get_string('questiondependencyfree', 'quiz')).then(
function(html) {
icon.replace(html);
}
);
});
}
}
};
Expand Down
18 changes: 14 additions & 4 deletions mod/quiz/yui/src/util/js/slot.js
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,23 @@ Y.Moodle.mod_quiz.util.slot = {
if (requiresprevious) {
link.set('title', M.util.get_string('questiondependencyremove', 'quiz', a));
link.setData('action', 'removedependency');
icon.set('alt', M.util.get_string('questiondependsonprevious', 'quiz'));
icon.set('src', M.util.image_url('t/locked', 'moodle'));
window.require(['core/templates'], function(Templates) {
Templates.renderPix('t/locked', 'core', M.util.get_string('questiondependsonprevious', 'quiz')).then(
function(html) {
icon.replace(html);
}
);
});
} else {
link.set('title', M.util.get_string('questiondependencyadd', 'quiz', a));
link.setData('action', 'adddependency');
icon.set('alt', M.util.get_string('questiondependencyfree', 'quiz'));
icon.set('src', M.util.image_url('t/unlocked', 'moodle'));
window.require(['core/templates'], function(Templates) {
Templates.renderPix('t/unlocked', 'core', M.util.get_string('questiondependencyfree', 'quiz')).then(
function(html) {
icon.replace(html);
}
);
});
}
}
};

0 comments on commit 84d4411

Please sign in to comment.