this.initheight=this.height; ////Debug.write("this.isopen: ",this.isopen); if (!this.open) toggleopen(); if (this.hasshadow) this.setShadow(); this.hasshadow = bool; if (this.onclose) this.onclose.sendEvent(); this.doDestroy(); ////Debug.write("this.isopen",this.isopen); this.setAttribute('isopen',!this.isopen); if (this.isopen){ _calcdockingList(); for (var eg in this.dockinglist){ if(this.dockinglist[eg].docking){ ////Debug.write("this.dockinglist[eg]: ",this.dockinglist[eg].title); ////Debug.write("open new y",this.y+this.initheight); this.dockinglist[eg].toggleOpenByParent(this.initheight-22); this.dockinglist[eg].setAttribute('y',this.y+this.initheight); } } this.setAttribute('height',this.initheight); } else { _calcdockingList(); for (var eg in this.dockinglist){ if(this.dockinglist[eg].docking){ ////Debug.write("this.dockinglist[eg]: ",this.dockinglist[eg].title); this.dockinglist[eg].toggleOpenByParent(-(this.initheight-22)); this.dockinglist[eg].setAttribute('y',this.y+22); } } this.setAttribute('height',22); } ////Debug.write("+++++ toggleOpenByParent +++++ changeY: ",this.title,changeY); var tempList=new Array(); -1 ) && ( (this.x+this.width) > this.parent.subviews[eg].x ) && ( this.x < (this.parent.subviews[eg].x+this.parent.subviews[eg].width) ) ){ proof=true; } if (proof) tempList.push(this.parent.subviews[eg]); } } ]]> ////Debug.write("tempList.length: ",tempList.length); if (tempList.length!=0){ for (var eg in tempList){ if(tempList[eg].docking){ ////Debug.write("toggleOpenByParent 1 [eg],changeY: ",tempList[eg].title,changeY); tempList[eg].toggleOpenByParent(changeY); tempList[eg].setAttribute('y',tempList[eg].y+changeY); } } } //It's important to remove the dragger and do docking stuff before you check for connencted Boxes dragger.remove(); if (obj==this){ if (docking) arrangePosition(); } else { if (docking) _lookforParentOnly(obj); } //check for connected Boxes for (var eg in this.dockinglist){ if(this.dockinglist[eg].docking){ this.dockinglist[eg]._removeDragState(this); } } mousetracker_del.unregisterAll(); this.preclose.sendEvent(); if (this.currentBoundingBox!=null) { if(this.currentBoundingBox.width>this.currentBoundingBox.height){ if (this.currentBoundingBox.y==0){ if ($debug) Debug.write("TOP"); if (this.topClassPanel!=""){ new lz[this.topClassPanel](parent,{ x:this.currentBoundingBox.x,y:this.currentBoundingBox.y }); } else { if ($debug) Debug.warn("No Top Panel Definied"); new lz[this.activationVClassBounding](parent,{ x:this.currentBoundingBox.x,y:this.currentBoundingBox.y }); } } else if (this.currentBoundingBox.y==(parent.height-this.currentBoundingBox.height)){ if ($debug) Debug.write("BOTTOM"); if (this.bottomClassPanel!=""){ new lz[this.bottomClassPanel](parent,{ x:this.currentBoundingBox.x,y:this.currentBoundingBox.y }); } else { new lz[this.activationVClassBounding](parent,{ x:this.currentBoundingBox.x,y:this.currentBoundingBox.y }); } } else { new lz[this.activationVClassBounding](parent,{ x:this.currentBoundingBox.x,y:this.currentBoundingBox.y }); } } else { if (this.currentBoundingBox.x==0){ if ($debug) Debug.write("RIGHT"); if (this.rightClassPanel!=""){ new lz[this.rightClassPanel](parent,{ x:this.currentBoundingBox.x,y:this.currentBoundingBox.y }); } else { new lz[this.activationClassBounding](parent,{ x:this.currentBoundingBox.x,y:this.currentBoundingBox.y }); } } else if (this.currentBoundingBox.x==(parent.width-this.currentBoundingBox.width)){ if ($debug) Debug.write("LEFT"); if (this.leftClassPanel!=""){ new lz[this.leftClassPanel](parent,{ x:this.currentBoundingBox.x,y:this.currentBoundingBox.y }); } else { new lz[this.activationClassBounding](parent,{ x:this.currentBoundingBox.x,y:this.currentBoundingBox.y }); } } else { new lz[this.activationClassBounding](parent,{ x:this.currentBoundingBox.x,y:this.currentBoundingBox.y }); } } this.currentBoundingBox.destroy(); this.close(); } else { if(this.width>this.height){ new lz[this.activationVClassBounding](parent,{x:this.x,y:this.y}); } else { new lz[this.activationClassBounding](parent,{x:this.x,y:this.y}); } this.close(); } this.bringToFront(); _calcdockingList(); for (var eg in this.dockinglist){ if(this.dockinglist[eg].docking){ this.dockinglist[eg]._startDragState(this); } } //store position cause it wasn't dragged by itself if (obj!=this){ storeAdjustmentToParent(obj.x,obj.y); } dragger.apply(); mousetracker_del.register(lz.Idle,'onidle'); if (this.currentBoundingBox!=null) this.currentBoundingBox.destroy(); this.currentBoundingBox = new lz.panelBoundBox(parent,{x:x,y:y, width:width,height:height}); //Clear list of conencted Boxes this.dockinglist=new Array(); -1 ) && ( (this.x+this.width) > this.parent.subviews[eg].x ) && ( this.x < (this.parent.subviews[eg].x+this.parent.subviews[eg].width) ) ){ proof=true; } if (proof) this.dockinglist.push(this.parent.subviews[eg]); } } ]]> ////Debug.write("this.dockinglist.length:",this.dockinglist.length); //do the magic //the idea is: look for all on the view container one level above this one //and look for the width/height and 0/0 and look for "dockable" stuff there var newx=this.x; var newy=this.y; -this.dockingbarrier ) && ( (this.y+this.height) > this.parent.subviews[eg].y ) && ( this.y < (this.parent.subviews[eg].y+this.parent.subviews[eg].height) ) ){ newx= ( this.parent.subviews[eg].x - this.width ); } //right box-border if ( ( ((this.parent.subviews[eg].x+this.parent.subviews[eg].width)-this.x)-this.dockingbarrier ) && ( (this.y+this.height) > this.parent.subviews[eg].y ) && ( this.y < (this.parent.subviews[eg].y+this.parent.subviews[eg].height) ) ){ newx= ( this.parent.subviews[eg].x + this.parent.subviews[eg].width ); } //top box-border if ( ( ((this.y+this.height)-this.parent.subviews[eg].y) < this.dockingbarrier ) && ( ((this.y+this.height)-this.parent.subviews[eg].y) > -this.dockingbarrier ) && ( (this.x+this.width) > this.parent.subviews[eg].x ) && ( this.x < (this.parent.subviews[eg].x+this.parent.subviews[eg].width) ) ){ newy = this.parent.subviews[eg].y-this.height; } //bottom box-border if ( ( ((this.parent.subviews[eg].y+this.parent.subviews[eg].height)-this.y) < this.dockingbarrier ) && ( ((this.parent.subviews[eg].y+this.parent.subviews[eg].height)-this.y) > -this.dockingbarrier ) && ( (this.x+this.width) > this.parent.subviews[eg].x ) && ( this.x < (this.parent.subviews[eg].x+this.parent.subviews[eg].width) ) ){ newy = this.parent.subviews[eg].y+this.parent.subviews[eg].height; } } } //Check for Borders //should be done _after_ checking for other dockable stuff so it gets //priority to dock against the border of parent view if (this.x this.tempXdistance=objX-this.x; this.tempYdistance=objY-this.y; this.destroy();