Class Papercube.DropDownView

Extends: SC.View
Defined in: clients/papercube/views/dropdown.js
Version: 1.0
Author: Peter Bergstrom
Copyright: 2008-2009 Peter Bergström.

Overview

This is a generic drop down. It is custom and not based on any SC drop down.

Property Summary

Method Summary

Property Details

_mouseDownHappened [R/W]

Indication that the mousedown event has happened.

-   Boolean _mouseDownHappened

Default Value: NO

Discussion

Used for the isButton variation.


button [R/W]

This is the DIV element that forms the button.

-   Object button


buttonAction [R/W]

The action of the button.

-   Function buttonAction


buttonLabel [R/W]

The label of the button as displayed in the HTML.

-   String buttonLabel

Default Value: 'Button'


choices [R/W]

Choices, bind to this.

-   Array choices

Default Value: ["default1", "default2"]


emptyElement [R/W]

Empty element is an empty DIV.

-   String emptyElement

Default Value: "[ '

', '
', '
', '
' ]"


funcScope [R/W]

The scope of the function calls, can be set to a controller, or something else.

-   Function funcScope

Default Value: this


isButton [R/W]

If it is a button drop down, it will act as a button unless depressed for 4/5ths of a second.

-   Boolean isButton

Default Value: YES


isEnabled [R/W]

Sets if the button is enabled or not, if it is disabled, it will be grayed out.

-   Boolean isEnabled

Default Value: YES


lazyListGenFuncFunc [R/W]

This is a function that generates your list on the fly.

-   Function lazyListGenFuncFunc

Discussion

Used instead of a binding to choices if present.


list [R/W]

This is the DIV element that forms the drop down.

-   Object list


orientationDown [R/W]

Orientation can either be up or down.

-   Boolean orientationDown

Default Value: YES

Discussion

Default is down.


outlets [R/W]

Outlets for author stat view.

-   Object outlets


selectionAction [R/W]

The action of the selection.

-   Function selectionAction


showingList [R/W]

Showing list boolean.

-   Boolean showingList

Default Value: NO


value [R/W]

Selected value, bind to this.

-   String value

Default Value: 'generic'


Method Detail

_showList()

Show list if delayed enough.

-   (void) _showList ()


init()

Initialization function.

-   (void) init ()

Discussion

Set the innerHTML to the emptyElement. This is done to get around a SC bug that uses default HTML in the Ruby helper instead of the emptyElement like it should.


isEnabledDidChange()

Observe value and set the innerHTML of the button.

-   (void) isEnabledDidChange ()

Observes

isEnabled


mouseDown()

Handle the mouseDown event.

-   (void) mouseDown (evt)

Parameters

(DOM Event)evt The mouseDown event.

Discussion

If the button has been clicked before show the list. If it is clicked again but it has the active class, hide the list.


mouseExited()

Hide the list and remove the active class.

-   (void) mouseExited (evt)

Parameters

(DOM Event)evt The mouseExited event.


mouseUp()

Select an item if the mouseUp event is on the list.

-   (void) mouseUp (evt)

Parameters

(DOM Event)evt The mouseUp event.


selectItem()

Select the value, then hide the list.

-   (void) selectItem (str)

Parameters

str {string} The selected item's string.


showList()

Show the list.

-   (void) showList ()

Discussion

Construct the HTML based on the type of list.


valueDidChange()

Observe value and set the innerHTML of the button.

-   (void) valueDidChange ()

Observes

value


Documentation generated by JsDoc Toolkit 2.0.2 on Sat Nov 21 2009 21:24:38 GMT-0800 (PST)