Skip to content
Gary Soedarsono edited this page Feb 2, 2015 · 10 revisions

ability.Draggable

extends: [[ability.Ability|ability.Ability]]

Provides decorator to make an element draggable. Use Abilities to decorate the element. Note that these methods should be called with the element to be decorated as the scope.

new ability.Draggable()

Attributes

pb-draggable Set to true to make this element draggable.

Properties

name string readonly The name of the ability. This is used as an ID to refer to the registered abilities.

Methods

setDefaultValue

setDefaultValue(!Element el)

Sets the default value of the given element.

el !Element The element whose default value should be set.

attributeChangedCallback

attributeChangedCallback(!Element el, String name, String oldValue, String newValue)

Handles attribute change.

el !Element The element whose attribute was changed.
name String Name of the attribute that was changed.
oldValue String Old value of the changed attribute.
newValue String New value of the changed attribute.

attachedCallback

attachedCallback(!Element el)

Handles registration when the element is attached to the document.

el !Element The element that was attached.

detachedCallback

detachedCallback(!Element el)

Handles unregistration when the element is detached from the document.

el !Element The element that was detached.

getMovedElement

!Element getMovedElement(!Element el)

Returns the element that will be moved, if the given element were to be dragged and dropped.

el !Element The element that is dragged.

returns !Element: The element that will be moved if the given element was dragged and dropped.