From db5308e25bb8b0a2b455ba3820d3776c8f8412ca Mon Sep 17 00:00:00 2001 From: vyshane Date: Wed, 11 Oct 2006 06:58:35 +0000 Subject: [PATCH] Merged from 1.7 --- lib/ajax/section_classes.js | 39 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/lib/ajax/section_classes.js b/lib/ajax/section_classes.js index 18d2832967..42e5f047af 100755 --- a/lib/ajax/section_classes.js +++ b/lib/ajax/section_classes.js @@ -12,12 +12,14 @@ function section_class(id,group,config,isDraggable) { } YAHOO.extend(section_class, YAHOO.util.DDProxy); + section_class.prototype.debug = true; + section_class.prototype.init_section = function(id, group,config,isDraggable) { if (!id) { return; } // id would be the html id attribute. - this.is = 'section'; + this.is = 'section'; this.sectionId = null; // Section number. This is NOT the section id from // the database. @@ -40,7 +42,7 @@ section_class.prototype.init_section = function(id, group,config,isDraggable) { this.hidden = false; this.highlighted = false; this.showOnly = false; - this.resources_ul = null; + this.resources_ul = null; this.process_section(); this.viewButton = null; @@ -117,7 +119,7 @@ section_class.prototype.process_section = function() { if (this.resources_ul == null) { this.resources_ul = document.createElement('ul'); this.resources_ul.className='section'; - this.content_td.insertBefore(this.resources_ul,this.content_td.childNodes[1]); + this.content_td.insertBefore(this.resources_ul, this.content_td.childNodes[2]); } var resource_count = this.resources_ul.getElementsByTagName('li').length; @@ -173,8 +175,6 @@ section_class.prototype.move_to_section = function(target) { var sectionCount = main.sections.length; var found = null; -this.debug = true; - //determine if original is above or below target and adjust loop var oIndex=main.get_section_index(this); var tIndex=main.get_section_index(target); @@ -197,13 +197,13 @@ this.debug = true; main.connect('post','class=section&field=move',null,'id='+this.sectionId+'&value='+(target.sectionId-this.sectionId)); //move on front end - for (var i=loopStart;eval(loopCondition);eval(loopInc)) { + for (var i=loopStart; eval(loopCondition); eval(loopInc)) { if ((main.sections[i] == this)&& !found) { //enounter with original node if (this.debug)YAHOO.log("Found Original "+main.sections[i].getEl().id); if (main.sections[i] == this) { - found = true; + found = true; } } else if (main.sections[i] == target) { @@ -214,10 +214,10 @@ this.debug = true; break; } else if (found) { - //encounter with nodes inbetween + //encounter with nodes inbetween main.sections[i].swap_with_section(main.sections[eval(loopmodifier)]); - } - } + } + } } @@ -234,7 +234,7 @@ section_class.prototype.swap_with_section = function(sectionIn) { if (this.debug)YAHOO.log("Swapping "+this.getEl().id+" with "+sectionIn.getEl().id); - YAHOO.util.DDM.swapNode(this.getEl(),sectionIn.getEl()); + YAHOO.util.DDM.swapNode(this.getEl(), sectionIn.getEl()); } section_class.prototype.toggle_hide = function(e,target,superficial) { @@ -375,12 +375,12 @@ section_class.prototype.insert_resource = function(el, targetel) { //update model if (targetel == null) { this.resources[this.resources.length] = el; - } else + } else { for (var i=0;i