This project is archived and is in readonly mode.

#7 ✓invalid
Thomas Aylott

onOutOfBounds option for Drag.Move

Reported by Thomas Aylott | May 28th, 2008 @ 09:59 AM | in 2.0 (closed)

Originally posted on Trac by gaelreth@…

Original Trac Ticket

Description

If a draggable element is specified with a limit, allow it to go out of those bounds but perform a special action when dropped such as an onOutOfBounds event. Fairly easy to implement I would say:

(Placed in Drag.Move stop method, just before the return statement)

if(this.options.limit) {
	var c = this.element.getCoordinates();
	var l = this.options.limit;
	var bounds = [];
	if(c.top  l.y[1]) bounds.push(3);
	if(c.left + c.width > l.x[1]) bounds.push(4);
	this.fireEvent('onOutOfBounds', [this, bounds]);
}

bounds array allows the onOutOfBounds function to know which bounds the element has moved out of and act accordingly.

Trac Attachments

Trac Comments

Changed 1 year ago by kamicane


        
Milestone Mootools version 1.01 deleted 

                  Changed 1 year ago by kamicane

          milestone
              changed from Mootools version 1.01 to Mootools version 1.1

Milestone Mootools version 1.01 deleted 

          milestone
              changed from Mootools version 1.01 to Mootools version 1.1
        
      

Changed 1 year ago by kamicane



                  Changed 1 year ago by kamicane

          status
              changed from new to closed
        
          resolution
              set to wontfix

          status
              changed from new to closed
        
          resolution
              set to wontfix
        
      

Changed 1 year ago by anonymous


        
treadmill 

      

Changed 10 months ago by anonymous


        
除湿机 

      

No comments found

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins

People watching this ticket

Pages