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.
This commit is contained in:
Damyon Wiese
2017-03-23 10:50:48 +08:00
parent b7cc51ca60
commit 6586ad36ed
2 changed files with 11 additions and 4 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+10 -3
View File
@@ -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);
};
@@ -591,4 +598,4 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
replaceActionItem(actionitem, image, stringname, stringcomponent, titlestr, titlecomponent, newaction);
}
};
});
});