Documentation

include MVC MVC.Animate MVC.Class MVC.Controller MVC.Controller.Action MVC.Controller.Action.Drag MVC.Controller.Action.Drop MVC.Controller.Action.EnterLeave MVC.Controller.Action.Event MVC.Controller.Action.Hover MVC.Controller.Action.Lasso MVC.Controller.Action.Selectable MVC.Controller.Action.Subscribe MVC.Controller.Comet MVC.Controller.Params MVC.Controller.Params.Drag MVC.Controller.Params.Drop MVC.Controller.Stateful MVC.Delegator MVC.Doc MVC.Element MVC.Event MVC.File MVC.History MVC.IO MVC.IO.Ajax MVC.IO.Comet MVC.IO.JsonP MVC.IO.WindowName MVC.IO.XDoc MVC.Model MVC.Model.Ajax MVC.Model.Cookie MVC.Model.JsonP MVC.Model.JsonRest MVC.Model.WindowName MVC.Model.XmlRest MVC.Native MVC.Native.Array MVC.Native.Date MVC.Native.Function MVC.Native.Number MVC.Native.Object MVC.Native.String MVC.Options MVC.Store MVC.SyntheticEvent MVC.Test MVC.Test.Assertions MVC.Test.Controller MVC.Test.Functional MVC.Test.Runner MVC.Test.Unit MVC.Timer MVC.Timer.Easings MVC.Vector MVC.View MVC.View.Helpers OpenAjax

MVC.Controller.Params.Drop

Drop actions are called with Params.Drop. The most important param function is cache_position. If your drop elements are not changing position after dragstart, use cache_position for large performance improvements.

Passing data from drag events to drop events

Drop params include a drag attribute, which contains the contents of the MVC.Draggable object that represented the drag. If you want to pass data to a drop event from your drag, you can save it in MVC.Controller.Params.Drag's drag_action attribute, and recover it from MVC.Controller.Params.Drop's drag attribute. For example:

Drag Controller

    dragstart: function(params){
		params.drag_action.data = {some: "data"};
    }

Drop Controller

    dropped: function(params){
		var data = params.drag.data;
    }

Constructor

MVC.Controller.Params.Drop

new MVC.Controller.Params.Drop() -> mvc.controller.params.drop

Same functionality as MVC.Controller.Params

Prototype Methods

cache_position

cache_position(value) -> undefined
Caches positions of draggable elements. This should be called in dropadd. For example:
 dropadd : function(params){ params.cache_position() }
{} -

cancel

cancel() -> undefined
cancels this drop