this.handle = null;
}
- this.createFrame();
+ this.createFrame();
this.isTarget = true;
this.resources = [];
}
-section_class.prototype.insert_resource = function(el,targetel) {
+section_class.prototype.insert_resource = function(el, targetel) {
var resourcecount = this.resources.length;
var found = false;
var tempStore = nextStore = null;
//update in backend
- targetId='';
- if (targetel !=null) {
- targetId=targetel.id;
- }
-
- main.connect('post','class=resource&field=move',null,'id='+el.id+'&beforeId='+targetId+'§ionId='+this.sectionId);
-
+ targetId = '';
+ if (targetel != null) {
+ targetId = targetel.id;
+ }
+ main.connect('post', 'class=resource&field=move', null,
+ 'id='+el.id+'&beforeId='+targetId
+ +'§ionId='+this.id.replace(/section-/i, ''));
//if inserting into a hidden resource hide
if (this.hidden) {
resource_class.prototype.onDragDrop = function(e, ids) {
// best fit Id
var id=[];
- for (var i=0;i<ids.length;i++)
- if (ids[i].is == 'resource')
- id[id.length] = ids[i];
- if (id.length == 0)
+ for (var i=0; i<ids.length; i++) {
+ if (ids[i].is == 'resource') {
+ id[id.length] = ids[i];
+ }
+ }
+ if (id.length == 0) {
id = ids;
-
+ }
// get the drag and drop object that was targeted
var target = YAHOO.util.DDM.getBestMatch(id);
- if (this.debug)YAHOO.log("dropped on id="+target+" el = "+this.getEl().id+" x="+YAHOO.util.Dom.getXY(this.getDragEl()));
-
- this.parentObj.remove_resource(this);
-
- if (target.is == 'resource'||target.is == 'activity') {
- target.parentObj.insert_resource(this,target);
+ if (this.debug) {
+ YAHOO.log("Dropped on section id="+target.id.replace(/section-/i, '')
+ +", el="+this.getEl().id
+ +", x="+YAHOO.util.Dom.getXY( this.getDragEl() ));
+ }
+/* var oldid = this.parentObj.id;
+ this.previousId = oldid.replace(/section-/i, '');*/
+ this.parentObj.remove_resource(this);
- } else if (target.is =='section') {
+ if (target.is == 'resource' || target.is == 'activity') {
+ target.parentObj.insert_resource(this, target);
+ } else if (target.is == 'section') {
target.insert_resource(this);
-
}
-
return;
-}
+}
resource_class.prototype.endDrag = function() {
- //eliminates default action
+ // Eliminates default action
}
-/*
- * activity Class extends resource class
- */
+/**
+ * activity Class extends resource class
+ */
function activity_class(id,group,config,parentObj) {
this.init_activity(id,group,config,parentObj);