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.Action.Drag

Adds drag functionality to controller actions with the following events:
  • dragstart - called when a drag is first moved.
  • dragging - called everytime the drag moves
  • dragend - called when someone releases a dragable object (mouseup)
Drags actions are called with MVC.Controller.Params.Drag. Use the drag params to change the behavior of the drag.

For more information on how Drag works read MVC.Draggable.

Install

include.plugins('controller/dragdrop')

Example

TasksController = MVC.Controller.extend('tasks',{
  ".handle dragstart" : function(params){
      //set something else to be dragged instead of this object
      params.representitive(MVC.$E('dragitem'), 15, 15);
      params.revert();
  },
  ".handle dragging" : function(params){

}, ".handle dragend" : function(params){

} }

Static Methods

match

Matches "(.*?)\\s?(dragstart|dragend|dragging)$"

Prototype Methods

init

init(action_name, callback, className, element, f, controller) -> undefined
Attaches a delegated mousedown function to the css selector for this action. Saves additional actions in callbacks.
{String} - the name of the function
{} -
{} -
{} -
{Function} - the function itself
{MVC.Controller} - the controller this action belongs to

mousedown

mousedown(element, params) -> undefined
Called when someone mouses down on a draggable object. Gathers all callback functions and creates a new Draggable.
{} -
{} -