Permalink
Browse files

MDL-31096 Handle addition/removal of mod-indent-huge to match non-aja…

…x display
  • Loading branch information...
1 parent eac3ed5 commit 95ef704d7d96a7f3f47d060d07cfee06a72f9106 @andrewnicols andrewnicols committed Apr 26, 2012
Showing with 9 additions and 0 deletions.
  1. +9 −0 course/yui/toolboxes/toolboxes.js
@@ -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

0 comments on commit 95ef704

Please sign in to comment.