/*************************************************************************** * module.drag.js * ------------------------ * Copyleft : (c) 2007 maborak.com * Version : 0.2 * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ /** * @class drag */ leimnud.Package.Public({ info :{ Class :"maborak", File :"module.drag.js", Name :"drag", Type :"module", Version :"0.1" }, content :function(options){ this.options = { limitbox:false }.concatMaborak(options || {}); this.loaded = false; this.eventHandlers=[]; this.cursor = "move"; this.uid = this.parent.tools.createUID(); this.make=function() { //alert(this.options.elements.isArray); //this.options.elements=(this.options.elements && !this.options.elements.length)?[this.options.elements]:this.options.elements this.options.elements=this.set(); this.options.fx = { type:"simple", target:document.body }.concatMaborak(this.options.fx || {}); this.events =this.events || {}; //alert(this.options.elements.length); var elements=(this.options.elements || []).length; this.flagEvents=[]; var oThis = this; for(var i=0;ithis.options.limitbox.clientWidth)){rG.l=false;} if((tT<0 || this.options.limit==="y") || (this.options.limitbox && (tT+element.clientHeight)>this.options.limitbox.clientHeight)){rG.t=false;} this.currentX = tL; this.currentY = tT; //var tL=parseInt(this.elementStart.x+(cursor.x-this.cursorStart.x),10); //var tT=parseInt(this.elementStart.y+(cursor.y-this.cursorStart.y),10); if(rG.l || !this.options.limit) { this.parent.dom.setStyle(element,{ left:tL }); } if(rG.t || !this.options.limit) { this.parent.dom.setStyle(element,{ top:tT }); } } else if(this.type=="group") { for(var i=0;i (screen.width - (element.clientWidth + 25))) { rG.l = false; } if (tT > (screen.height - (element.clientHeight + 200))) { rG.t = false; } if(rG.l) { this.parent.dom.setStyle(this.linkRef[i],{ left:tL }); } if(rG.t) { this.parent.dom.setStyle(this.linkRef[i],{ top:tT }); } } } else { for(i=0;i