Merge branch 'wip-MDL-37901_M23' of git://github.com/gjb2048/moodle into MOODLE_23_STABLE

This commit is contained in:
Sam Hemelryk
2013-03-05 15:23:09 +13:00
2 changed files with 30 additions and 2 deletions
+15 -1
View File
@@ -56,6 +56,9 @@ M.course.format.swap_sections = function(Y, node1, node2) {
M.course.format.process_sections = function(Y, sectionlist, response, sectionfrom, sectionto) {
var CSS = {
SECTIONNAME : 'sectionname'
},
SELECTORS = {
SECTIONLEFTSIDE : '.left .section-handle img'
};
if (response.action == 'move') {
@@ -65,9 +68,20 @@ M.course.format.process_sections = function(Y, sectionlist, response, sectionfro
sectionto = sectionfrom;
sectionfrom = temp;
}
// Update titles in all affected sections.
// Update titles and move icons in all affected sections.
var ele, str, stridx, newstr;
for (var i = sectionfrom; i <= sectionto; i++) {
// Update section title.
sectionlist.item(i).one('.'+CSS.SECTIONNAME).setContent(response.sectiontitles[i]);
// Update move icon.
ele = sectionlist.item(i).one(SELECTORS.SECTIONLEFTSIDE);
str = ele.getAttribute('alt');
stridx = str.lastIndexOf(' ');
newstr = str.substr(0, stridx +1) + i;
ele.setAttribute('alt', newstr);
ele.setAttribute('title', newstr); // For FireFox as 'alt' is not refreshed.
}
}
}
+15 -1
View File
@@ -56,6 +56,9 @@ M.course.format.swap_sections = function(Y, node1, node2) {
M.course.format.process_sections = function(Y, sectionlist, response, sectionfrom, sectionto) {
var CSS = {
SECTIONNAME : 'sectionname'
},
SELECTORS = {
SECTIONLEFTSIDE : '.left .section-handle img'
};
if (response.action == 'move') {
@@ -65,9 +68,20 @@ M.course.format.process_sections = function(Y, sectionlist, response, sectionfro
sectionto = sectionfrom;
sectionfrom = temp;
}
// Update titles in all affected sections.
// Update titles and move icons in all affected sections.
var ele, str, stridx, newstr;
for (var i = sectionfrom; i <= sectionto; i++) {
// Update section title.
sectionlist.item(i).one('.'+CSS.SECTIONNAME).setContent(response.sectiontitles[i]);
// Update move icon.
ele = sectionlist.item(i).one(SELECTORS.SECTIONLEFTSIDE);
str = ele.getAttribute('alt');
stridx = str.lastIndexOf(' ');
newstr = str.substr(0, stridx +1) + i;
ele.setAttribute('alt', newstr);
ele.setAttribute('title', newstr); // For FireFox as 'alt' is not refreshed.
}
}
}