Class: UWA.Controls.DropDown.Pointy

UWA/Controls/DropDown. UWA.Controls.DropDown.Pointy

new UWA.Controls.DropDown.Pointy(options)

A simple positionned dropdown that points a given element or coordinates.

Available Events

All events inherited from UWA.Controls.DropDown.

Examples
var dropdown = new UWA.Control.DropDown.Pointy({
    target: myElement
}).inject(myElement, 'after');

dropdown.getInnerElement().setContent('In case the curse does not succeed, this is my lucky stake.');

myElement.addEvent('click', dropdown.show.bind(dropdown));
var dropdown = new UWA.Control.DropDown.Pointy();
dropdown.inject(myElement, 'after');

dropdown.getInnerElement().setContent('In case the curse does not succeed, this is my lucky stake.');

myElement.addEvent('click', function (e) {
    dropdown.setPosition(UWA.Event.getPosition(e), {
        relative: document.body // event position is absolute, so set the position relative
                                // to the body
    });
    dropdown.show();
});
Parameters
Name Type Description
options Object

Options hash or a option/value pair.

Properties
Name Type Argument Default Description
target HTMLElement <optional>
undefined

Points toward this element.

autoPosition Object | Function <optional>

An array of preferred position relative to the target element. Each value of this array should be a string of the form '<side>-<alignment>' where <side> is either 'below', 'right', 'left' or 'above' and <alignment> is either 'start', 'center' or 'end'. Default: ['below-center', 'right-start', 'left-start', 'above-center']

margin Number <optional>
12

Space between the dropdown and the element.

Extends

  • UWA.Controls.DropDown

Index

Members

name :String

The control name. Defaults to 'uwa-pointydropdown'.

Type
  • String

Methods

updatePosition()

Overrides UWA.Controls.DropDown.updatePosition.

updatePointPosition(place)

Move the point toward the target.

Parameters
Name Type Description
place String

Where to place the point ('below', 'above', 'left' or 'right')

getInnerElement()

Overrides UWA.Controls.DropDown.getInnerElement.

getContent()

Overrides UWA.Controls.DropDown.getContent.