Skip to content

Commit 6586ad3

Browse files
author
Damyon Wiese
committed
MDL-40759 fontawesome: Fix section highlighting
The section highlighting code was re-written in parallel to font-awesome - so we need to apply the same font-awesome tweaks here now.
1 parent b7cc51c commit 6586ad3

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

course/amd/build/actions.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

course/amd/src/actions.js

+10-3
Original file line numberDiff line numberDiff line change
@@ -355,15 +355,22 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
355355
*/
356356
var replaceActionItem = function(actionitem, image, stringname,
357357
stringcomponent, titlestr, titlecomponent, newaction) {
358-
actionitem.find('img').attr('src', url.imageUrl(image, 'core'));
358+
359359
str.get_string(stringname, stringcomponent).done(function(newstring) {
360360
actionitem.find('span.menu-action-text').html(newstring);
361361
actionitem.attr('title', newstring);
362362
});
363363
if (titlestr) {
364-
str.get_string(titlestr, titlecomponent).done(function(newtitle) {
364+
str.get_string(titlestr, titlecomponent).then(function(newtitle) {
365+
templates.renderPix(image, 'core', newtitle).then(function(html) {
366+
actionitem.find('.icon').replaceWith(html);
367+
});
365368
actionitem.attr('title', newtitle);
366369
});
370+
} else {
371+
templates.renderPix(image, 'core', '').then(function(html) {
372+
actionitem.find('.icon').replaceWith(html);
373+
});
367374
}
368375
actionitem.attr('data-action', newaction);
369376
};
@@ -591,4 +598,4 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
591598
replaceActionItem(actionitem, image, stringname, stringcomponent, titlestr, titlecomponent, newaction);
592599
}
593600
};
594-
});
601+
});

0 commit comments

Comments
 (0)