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
-
- (Boolean) _mouseDownHappened [R/W]Indication that the mousedown event has happened. -
- (Object) button [R/W]This is the DIV element that forms the button. -
- (Function) buttonAction [R/W]The action of the button. -
- (String) buttonLabel [R/W]The label of the button as displayed in the HTML. -
- (Array) choices [R/W]Choices, bind to this. -
- (String) emptyElement [R/W]Empty element is an empty DIV. -
- (Function) funcScope [R/W]The scope of the function calls, can be set to a controller, or something else. -
- (Boolean) 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) isEnabled [R/W]Sets if the button is enabled or not, if it is disabled, it will be grayed out. -
- (Function) lazyListGenFuncFunc [R/W]This is a function that generates your list on the fly. -
- (Object) list [R/W]This is the DIV element that forms the drop down. -
- (Boolean) orientationDown [R/W]Orientation can either be up or down. -
- (Object) outlets [R/W]Outlets for author stat view. -
- (Function) selectionAction [R/W]The action of the selection. -
- (Boolean) showingList [R/W]Showing list boolean. -
- (String) value [R/W]Selected value, bind to this.
Method Summary
-
- (void) _showList()Show list if delayed enough. -
- (void) init()Initialization function. -
- (void) isEnabledDidChange()Observe value and set the innerHTML of the button. -
- (void) mouseDown(evt)Handle the mouseDown event. -
- (void) mouseExited(evt)Hide the list and remove the active class. -
- (void) mouseUp(evt)Select an item if the mouseUp event is on the list. -
- (void) selectItem(str)Select the value, then hide the list. -
- (void) showList()Show the list. -
- (void) valueDidChange()Observe value and set the innerHTML of the button.
Property Details
_mouseDownHappened [R/W]
Indication that the mousedown event has happened.
- Boolean _mouseDownHappened
Default Value: NO
Discussion
Used for the isButton variation.
buttonLabel [R/W]
The label of the button as displayed in the HTML.
- String buttonLabel
Default Value: 'Button'
emptyElement [R/W]
Empty element is an empty DIV.
- String emptyElement
Default Value: "[
'',
' The scope of the function calls, can be set to a controller, or something else.
-
Function
funcScope
Default Value: this
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
Sets if the button is enabled or not, if it is disabled, it will be grayed out.
-
Boolean
isEnabled
Default Value: YES
This is a function that generates your list on the fly.
-
Function
lazyListGenFuncFunc
Used instead of a binding to choices if present. Orientation can either be up or down.
-
Boolean
orientationDown
Default Value: YES
Default is down. Initialization function.
-
(void)
init ()
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. Observe value and set the innerHTML of the button.
-
(void)
isEnabledDidChange ()
isEnabled
Handle the mouseDown event.
-
(void)
mouseDown (evt)
(DOM Event)evt
The mouseDown event.
If the button has been clicked before show the list. If it is clicked again but it has the active class, hide the list. Hide the list and remove the active class.
-
(void)
mouseExited (evt)
(DOM Event)evt
The mouseExited event.
Select an item if the mouseUp event is on the list.
-
(void)
mouseUp (evt)
(DOM Event)evt
The mouseUp event.
Select the value, then hide the list.
-
(void)
selectItem (str)
str
{string} The selected item's string.
Show the list.
-
(void)
showList ()
Construct the HTML based on the type of list. Observe value and set the innerHTML of the button.
-
(void)
valueDidChange ()
value
funcScope
[R/W]
isButton
[R/W]
isEnabled
[R/W]
lazyListGenFuncFunc
[R/W]
Discussion
orientationDown
[R/W]
Discussion
Method Detail
init()
Discussion
isEnabledDidChange()
Observes
mouseDown()
Parameters
Discussion
mouseExited()
Parameters
mouseUp()
Parameters
selectItem()
Parameters
showList()
Discussion
valueDidChange()
Observes