MDL-31096 Handle addition/removal of mod-indent-huge to match non-ajax display

This commit is contained in:
Andrew Robert Nicols
2012-04-26 11:02:39 +01:00
parent eac3ed52c7
commit 95ef704d7d
+9
View File
@@ -20,6 +20,7 @@ YUI.add('moodle-course-toolboxes', function(Y) {
LIGHTBOX : 'lightbox',
MODINDENTCOUNT : 'mod-indent-',
MODINDENTDIV : 'div.mod-indent',
MODINDENTHUGE : 'mod-indent-huge',
MODULEIDPREFIX : 'module-',
MOVELEFT : 'a.editing_moveleft',
MOVELEFTCLASS : 'editing_moveleft',
@@ -346,6 +347,14 @@ YUI.add('moodle-course-toolboxes', function(Y) {
} else if (newindent == 1 && oldindent == 0) {
this.add_moveleft(element);
}
// Handle massive indentation to match non-ajax display
var hashugeclass = indentdiv.hasClass(CSS.MODINDENTHUGE);
if (newindent > 15 && !hashugeclass) {
indentdiv.addClass(CSS.MODINDENTHUGE);
} else if (newindent <= 15 && hashugeclass) {
indentdiv.removeClass(CSS.MODINDENTHUGE);
}
},
delete_resource : function(e) {
// Get the element we're working on