diff --git a/lib/ajax/section_classes.js b/lib/ajax/section_classes.js index 1616a00ad34..b08bd8272d0 100755 --- a/lib/ajax/section_classes.js +++ b/lib/ajax/section_classes.js @@ -4,6 +4,14 @@ * * This library requires a 'main' object created in calling document. * + * Drag and drop notes: + * + * Dropping an activity or resource on a section will always add the activity + * or resource at the end of that section. + * + * Dropping an activity or resource on another activity or resource will + * always move the former just above the latter. + * * $Id$ */ @@ -128,19 +136,19 @@ section_class.prototype.process_section = function() { this.resources_ul.className='section'; this.content_td.insertBefore(this.resources_ul, this.content_td.childNodes[1]); } - var resource_count = this.resources_ul.getElementsByTagName('li').length; for (var i=0;i 0) { + // We need to have a border at the bottom of the last activity in + // that section. + YAHOO.util.Dom.setStyle(target.resources[target.resources.length - 1].getEl().id, + 'border-bottom', '1px solid #BBB'); + } +} + +resource_class.prototype.onDragOut = function(e, ids) { + var target = YAHOO.util.DDM.getBestMatch(ids); + this.clear_move_markers(target); +} + resource_class.prototype.onDragDrop = function(e, ids) { - // best fit Id - var id=[]; - - for (var i=0; i