To constraint the movement to a specific area, I added the following lines in dragdrop.js
This will allow you to specify: area: [2,3,100,120]
to draw a rectangular area where movement is allowed...
might have very strange side effects, just needed a quick/dirty hack. Plus I installed script.aculo.us just 10 minutes ago :)
Don't flame pls.
Manuele
 
 
line:202 (please note the "," after snap: false)
      snap: false,   // false, or xy or [x,y] or function(x,y){ return [x,y] }
      area: false // false, or [x,y,offsetX,offsetY]
 
line:357
 
    var style = this.element.style;
    if (this.options.area) {
     if (p[0] < this.options.area[0]) p[0] = this.options.area[0];
     if (p[0] > this.options.area[0]+this.options.area[2]) p[0] = this.options.area[0]+this.options.area[2];
     if (p[1] < this.options.area[1]) p[1] = this.options.area[1];
     if (p[1] > this.options.area[1]+this.options.area[3] ) p[1] = this.options.area[1]+this.options.area[3];
    }
_______________________________________________
Rails-spinoffs mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to