|
PHP2Go Javascript Framework | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--ColorPicker
Defined in widgets/colorpicker.js
| Field Summary | |
Object |
container
Container element, used by flat mode |
String |
curColor
Current selected color |
String |
defaultColor
Default color |
Boolean |
disabled
Enable state |
String |
id
Component id |
String |
mode
Component mode - flat or popup |
String |
nullColor
Color to be used as initial/reset value for highlight area and text input |
Function |
onClose
If set, will be called when a popup color picker is closed |
Function |
onOpen
If set, will be called when a popup color picker opens |
Function |
onSelect
Called when a color is selected. |
Object |
text
Holds the text input used to display the RGB value |
Object |
trigger
Trigger element, used by popup mode |
| Constructor Summary | |
ColorPicker
(<Object> opts)
The ColorPicker class builds a color picker widget. |
|
| Method Summary | |
void
|
build()
This method is called from inside ColorPicker.setup() and builds the HTML structure of the color picker. |
void
|
colorClick(item)
Handles the onClick event of a color cell. |
void
|
colorOut()
Handles the onMouseOut event on a color cell |
void
|
colorOver(item)
Handles the onMouseOver event on a color cell |
void
|
hidePopup()
Hides the color picker popup |
void
|
mouseDownHandler(<Event> e)
Listen to mousedown events in the HTML document. |
String
|
rgbToHex(s)
Utility method to convert a color from rgb(N, N, N) format to #XXXXXX format |
void
|
setColor(<String> color)
Change current selected color of the widget |
void
|
setDisabled(<Boolean> b)
Enable/disable the component |
void
|
setup()
Initialize the component, settin up the necessary events and element attributes. |
void
|
showPopupAt(<Object> trg)
Shows the color picker popup in the right side of a given trigger |
| Field Detail |
Object container
String curColor
String defaultColor
Boolean disabled
String id
String mode
String nullColor
Function onClose
Function onOpen
Function onSelect
Object text
Object trigger
| Constructor Detail |
ColorPicker(<Object> opts)
opts - Set of configuration options
| Method Detail |
void build()
void colorClick(item)
Object - item Color cell
void colorOut()
Object - item Color cell
void colorOver(item)
Object - item Color cell
void hidePopup()
void mouseDownHandler(<Event> e)
e - Event
String rgbToHex(s)
String - s Color string to be converted
void setColor(<String> color)
color - Color, in RGB format #[0-9]{3-6}
void setDisabled(<Boolean> b)
b - Flag value
void setup()
void showPopupAt(<Object> trg)
trg - Trigger element
|
PHP2Go Javascript Framework | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||