MDL-48947 course: Adding the new extra span after dropping a section
authorDavid Monllao <davidm@moodle.com>
Fri, 2 Oct 2015 03:12:24 +0000 (11:12 +0800)
committerDavid Monllao <davidm@moodle.com>
Fri, 2 Oct 2015 03:12:24 +0000 (11:12 +0800)
course/format/topics/format.js
course/format/upgrade.txt
course/format/weeks/format.js

index 4e98edb..7b41c39 100644 (file)
@@ -74,7 +74,8 @@ M.course.format.process_sections = function(Y, sectionlist, response, sectionfro
 
         for (var i = sectionfrom; i <= sectionto; i++) {
             // Update section title.
-            sectionlist.item(i).all('.'+CSS.SECTIONNAME).setContent(response.sectiontitles[i]);
+            var content = Y.Node.create('<span>' + response.sectiontitles[i] + '</span>');
+            sectionlist.item(i).all('.'+CSS.SECTIONNAME).setHTML(content);
             // Update move icon.
             ele = sectionlist.item(i).one(SELECTORS.SECTIONLEFTSIDE);
             str = ele.getAttribute('alt');
index 4878b9b..2f216c2 100644 (file)
@@ -5,6 +5,8 @@ Overview of this plugin type at http://docs.moodle.org/dev/Course_formats
 === 3.0 ===
 * Course formats should now use section_edit_control_items and use the returned array of controls items and their attributes to create a
   renderable menu or array of links.  Plugin calls to section_edit_controls will now include the section edit control in the returned array.
+* The section name is now wrapped in a new span (.sectionname > span), process_sections method in format.js should be updated so .sectionname
+  DOM node's wraps the section title in a span. You can look at how to implement the change in course/format/topics/format.js or MDL-48947.
 
 === 2.9 ===
 * Course formats may support deleting sections, see MDL-10405 for more details.
index 546a24f..c9d072f 100644 (file)
@@ -74,7 +74,8 @@ M.course.format.process_sections = function(Y, sectionlist, response, sectionfro
 
         for (var i = sectionfrom; i <= sectionto; i++) {
             // Update section title.
-            sectionlist.item(i).all('.'+CSS.SECTIONNAME).setContent(response.sectiontitles[i]);
+            var content = Y.Node.create('<span>' + response.sectiontitles[i] + '</span>');
+            sectionlist.item(i).all('.'+CSS.SECTIONNAME).setHTML(content);
 
             // Update move icon.
             ele = sectionlist.item(i).one(SELECTORS.SECTIONLEFTSIDE);