API Docs for: 1.7.0
Show:

photonui.ColorPickerDialog Class

Extends photonui.Dialog
Module: Composite
Parent Module: PhotonUI

Color Picker Dialog.

wEvents:

  • value-changed:
    • description: the selected color changed.
    • callback: function(widget, color)

Constructor

photonui.ColorPickerDialog

()

Methods

__internalDragging

(
  • offsetX
  • offsetY
  • pageX
  • pageY
)
private
Move the window.

Parameters:

__onCancel

() private

__onColorChanged

() private

__onContextMenu

(
  • event
)
private
Called when the context menu should be displayed.

Parameters:

__onLocaleChanged

() private

Inherited from photonui.Widget but overwritten in src/container/window.js:479

Called when the locale is changed.

__onValidate

() private

_bindEvent

(
  • id
  • element
  • evName
  • callback
)
private

Inherited from photonui.Base: src/base.js:229

Javascript event binding (for internal use).

Parameters:

  • id String
    An unique id for the event.
  • element DOMElement
    The element on which the event will be bind.
  • evName String
    The event name (e.g. "mousemove", "click",...).
  • callback Function
    The function that will be called when the event occured.

_buildHtml

() private

Inherited from photonui.Widget but overwritten in src/container/dialog.js:214

Build the widget HTML.

_buildUi

() private

Make the UI.

_callCallbacks

(
  • wEvent
  • params
)
private

Inherited from photonui.Base: src/base.js:288

Call all callbacks for the given wEvent. NOTE: the first argument passed to the callback is the current widget. NOTEĀ²: if the thisArg of the callback is null, this will be binded to the current widget.

Parameters:

  • wEvent String
    The widget event.
  • params Array
    Parametters that will be sent to the callbacks.

_closeButtonClicked

(
  • event
)
private
Close button clicked.

Parameters:

_moveDragEnd

(
  • event
)
private
Stop moving the window.

Parameters:

_moveDragging

(
  • offsetX
  • offsetY
  • event
)
private
Move the window.

Parameters:

_moveDragStart

(
  • event
)
private
Start moving the window.

Parameters:

_moveTouchEnd

(
  • event
)
private

Inherited from photonui.Window but overwritten in src/container/window.js:431

Stop moving the window.

Parameters:

_moveTouchMove

(
  • offsetX
  • offsetY
  • event
)
private
Move the window.

Parameters:

_moveTouchStart

(
  • event
)
private
Start moving the window.

Parameters:

_registerWEvents

(
  • wEvents
)
private

Inherited from photonui.Base: src/base.js:272

Register available wEvent.

Parameters:

_unbindEvent

(
  • id
)
private

Inherited from photonui.Base: src/base.js:253

Unbind javascript event.

Parameters:

  • id String
    The id of the event.

_updateButtons

() private
Update dialog buttons.

_updateProperties

(
  • properties
)
deprecated private

Inherited from photonui.Base: src/base.js:209

Force the update of the given properties. This method is deprecated. One should use '@photonui-update' abitbol's annotation on concerned properties.

Parameters:

  • properties Array
    The properties to update.

_updateUi

() private

Update the fields of the UI.

_updateWindowList

() private
Update all the windows.

_visibilityChanged

(
  • visibility
)
private

Inherited from photonui.Widget but overwritten in src/container/dialog.js:229

Called when the visibility changes.

Parameters:

  • visibility Boolean
    Current visibility state (otptional, defaut=this.visible)

addButton

(
  • widget
)
Add a button to the dialog.

Parameters:

addClass

(
  • className
)
Add a class to the outer HTML element of the widget.

Parameters:

  • className String
    The class to add.

center

()
Center the window.

destroy

()

Inherited from photonui.Base but overwritten in src/container/dialog.js:183

Destroy the widget.

hide

()
Hide the widget (equivalent to widget.visible = false).

moveToBack

()
Bring the window to the back.

moveToFront

()
Bring the window to front.

registerCallback

(
  • id
  • wEvent
  • callback
  • thisArg
)

Inherited from photonui.Base: src/base.js:169

Register a callback for any PhotonUI/Widget event (called wEvent). Callback signature: function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]])

Parameters:

  • id String
    An unique id for the callback.
  • wEvent String
    the PhotonUI/Widget event name.
  • callback Function
    The callback function.
  • thisArg Object
    The value of this (optionnal, default = current widget).

removeButton

(
  • widget
)
Remove a button from the dialog.

Parameters:

removeCallback

(
  • id
)

Inherited from photonui.Base: src/base.js:193

Remove a registered callback.

Parameters:

  • id String
    The id of the callback.

removeChild

(
  • widget
)
Remove the given child.

Parameters:

removeClass

(
  • className
)
Remove a class from the outer HTML element of the widget.

Parameters:

  • className String
    The class to remove.

show

()
Display the widget (equivalent to widget.visible = true).

unparent

()
Detache the widget from its parent.

Properties

__callbacks

Object private

Inherited from photonui.Base: src/base.js:142

Object containing references to registered callbacks.

__events

Object private

Inherited from photonui.Base: src/base.js:132

Object containing references javascript events binding (for widget internal use).

__html

Object private
Object containing references to the widget HTML elements

absolutePosition

Object
Absolute position of the widget on the page. {x: Number, y: Number}

buttons

Array
Dialog buttons widgets.

Default: []

buttonsNames

Array
Dialog button widgets name.

Default: []

child

photonui.Widget
The child widget.

Default: null (no child)

childName

String
The child widget name.

Default: null (no child)

closeButtonVisible

Boolean default: true
Determine if the close button in the title bar is displayed or not.

containerNode

HTMLElement

Inherited from photonui.Container but overwritten in src/container/window.js:199

HTML Element that contain the child widget HTML.

contextMenu

photonui.PopupWindow
The managed contextual menu.

Default: null (= no context menu)

contextMenuName

String
The name of the managed contextual menu (photonui.PopupWindow().name).

Default: null (= no context menu)

data

Object

Inherited from photonui.Base: src/base.js:113

Arbitrary data

Default: {}

fullscreen

Boolean
Fullscreen Window

Default: false

height

Number
Height of the container node.

Default: : null (auto)

horizontalChildExpansion

Boolean
Horizontaly expand the container's child widget.

Default: true

html

HTMLElement

Inherited from photonui.Widget but overwritten in src/container/basewindow.js:311

Html outer element of the widget (if any).

Default: null

layoutOptions

Object
Layout options.

Default: {}

maxHeight

Number
Maximum height of the container node.

Default: : null (no maximum)

maxWidth

Number
Maximum width of the container node.

Default: : null (no maximum)

minHeight

Number
Minimum height of the container node.

Default: : null (no minimum)

minWidth

Number
Minimum width of the container node.

Default: : null (no minimum)

modal

Boolean
Modal window?

Default: false

movable

Boolean
Determine if the window can be moved (drag & drop) by the user.

Default: true

name

String
The unique name of the widget.

Default: "widget-" + uuid.v4()

offsetHeight

Number
Widget height (outer HTML element).

offsetWidth

Number
Widget width (outer HTML element).

padding

Number
Window container node padding.

Default: 0

parent

photonui.Widget
The parent widget.

Default: null (no parent)

parentName

String
The parent widget name.

Default: null (no parent)

position

Object
Window position. {x: Number, y: Number}

Default: {x: 0, y: 0}

title

String
The window title.

Default: "Window"

tooltip

String
Tooltip.

Default: null

value

String

The color as hex string (shorthand to ColorPickerDialog.color.rgbHexString).

verticalChildExpansion

Boolean
Verticaly expand the container's child widget.

Default: false

visible

Boolean
Is the widget visible or hidden.

Default: true

width

Number
Width of the container node.

Default: : null (auto)

x

Number
The X position of the Window.

Default: 0

y

Number
The Y position of the Window.

Default: 0