RasterTabbarEvent.position

Access: readonly
Type: string
Indicates the position where the value being dragged is about to be dropped. This property may be one of the following:

Position Value Description before Drop will happen before the given item. over Drop will happen over the given item. after Drop will happen after the given item.

If the event handler wishes to accept a drop of the dragValue at the current location, it must call RasterEvent.accept() highlight the item as a potential drop target (i.e. draw insertion line or shaded box at the item's location).

The event handler may alter the default drop effect by passing a new position value to RasterEvent.accept() method. For example, if a tab bar doesn't want to accept dragged values "over" any item, it can pass the argument "before" to the accept() method. This will make the drop target to render as an "insertion line" before the item instead of a "shaded box" over the item.

function myHandler( e )
{
    :
    // do not accept drag values 'over' items,
    // only 'before' or 'after'
    if ( e.position=="over"  )
        e.accept( "before" ); // overwrite "over" with "before"
    else
        e.accept(); // accept current drop position

}

See Also

Home Examples Download License
 
Copyright © 2010-2017 Edwin R. López