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

Drag actions are called with Params.Drag. Use Params.Drag to alter drag functionality including:
  • Stop Dragging
  • Ghost drag
  • Change the drag element
  • Revert the drag element
Drag actions are also called with the following attributes:
AttributeDescription
drag_action MVC.Draggable object that represents this drag
drag_element The element that is actually being dragged
element The element that represents the action
event On dragstart+dragging, this is a mousemove event. On dragend, it is a mouseup.

Adding to drag params

You might want to add your own functionality to draggable items. Adding to MVC.Controller.Params.Drag.prototype will make those functions always available.

Constructor

MVC.Controller.Params.Drag

new MVC.Controller.Params.Drag() -> mvc.controller.params.drag

Same functionality as MVC.Controller.Params

Prototype Methods

cancel_drag

cancel_drag() -> undefined
Stops drag from running.

ghost

ghost(callback) -> undefined
Clones an element and uses it as the representitive element.
{Function} -

horizontal

horizontal() -> undefined
Isolates the drag to horizontal movement.

position

position(newposition, the) -> undefined
Gets or sets the new position
{MVC.Vector} -
{MVC.Vector} - position the page will be updated to

representitive

representitive(element, offsetX, offsetY) -> undefined
Use a representitive element, instead of the drag_element.
{HTMLElement} - the element you want to actually drag
{Number} - the x position where you want your mouse on the object
{Number} - the y position where you want your mouse on the object

revert

revert() -> undefined
Makes the drag_element go back to its original position after drop.

vertical

vertical() -> undefined
Isolates the drag to vertical movement.