Skip to content

Commit

Permalink
MDL-40759 fontawesome: Fix section highlighting
Browse files Browse the repository at this point in the history
The section highlighting code was re-written in parallel to font-awesome - so we need
to apply the same font-awesome tweaks here now.
  • Loading branch information
Damyon Wiese committed Mar 23, 2017
1 parent b7cc51c commit 6586ad3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion course/amd/build/actions.min.js

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

13 changes: 10 additions & 3 deletions course/amd/src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,15 +355,22 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
*/
var replaceActionItem = function(actionitem, image, stringname,
stringcomponent, titlestr, titlecomponent, newaction) {
actionitem.find('img').attr('src', url.imageUrl(image, 'core'));

str.get_string(stringname, stringcomponent).done(function(newstring) {
actionitem.find('span.menu-action-text').html(newstring);
actionitem.attr('title', newstring);
});
if (titlestr) {
str.get_string(titlestr, titlecomponent).done(function(newtitle) {
str.get_string(titlestr, titlecomponent).then(function(newtitle) {
templates.renderPix(image, 'core', newtitle).then(function(html) {
actionitem.find('.icon').replaceWith(html);
});
actionitem.attr('title', newtitle);
});
} else {
templates.renderPix(image, 'core', '').then(function(html) {
actionitem.find('.icon').replaceWith(html);
});
}
actionitem.attr('data-action', newaction);
};
Expand Down Expand Up @@ -591,4 +598,4 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
replaceActionItem(actionitem, image, stringname, stringcomponent, titlestr, titlecomponent, newaction);
}
};
});
});

0 comments on commit 6586ad3

Please sign in to comment.