MDL-40759 fontawesome: Fix section highlighting
authorDamyon Wiese <damyon@moodle.com>
Thu, 23 Mar 2017 02:50:48 +0000 (10:50 +0800)
committerDamyon Wiese <damyon@moodle.com>
Thu, 23 Mar 2017 02:50:48 +0000 (10:50 +0800)
The section highlighting code was re-written in parallel to font-awesome - so we need
to apply the same font-awesome tweaks here now.

course/amd/build/actions.min.js
course/amd/src/actions.js

index 797a71e..d8e4d3b 100644 (file)
Binary files a/course/amd/build/actions.min.js and b/course/amd/build/actions.min.js differ
index 5c4a72c..da81240 100644 (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);
             }
         };
-    });
\ No newline at end of file
+    });