photonui.Widget Class
Base class for all PhotonUI widgets.
wEvents:
-
show:
- description: called when the widget is displayed (a change in the parent's visibility can also trigger this event).
- callback: function(widget)
-
hide:
- description: called when the widget is hidden (a change in the parent's visibility can also trigger this event).
- callback: function(widget)
Constructor
photonui.Widget
-
params
Parameters:
-
params
ObjectAn object that can contain any property of the widget (optional).
Item Index
Methods
Methods
__onContextMenu
-
event
Called when the context menu should be displayed.
Parameters:
-
event
Object
__onLocaleChanged
()
private
Called when the locale is changed.
_bindEvent
-
id
-
element
-
evName
-
callback
-
[options]
Javascript event binding (for internal use).
Parameters:
_buildHtml
()
private
Build the widget HTML.
_callCallbacks
-
wEvent
-
params
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.
_updateProperties
-
properties
Force the update of the given properties.
This method is deprecated. One should use '@photonui-update' abitbol's annotation on concerned properties.
Parameters:
-
properties
ArrayThe properties to update.
_visibilityChanged
-
visibility
Called when the visibility changes.
Parameters:
-
visibility
BooleanCurrent visibility state (otptional, defaut=this.visible)
addClass
-
className
Add a class to the outer HTML element of the widget.
Parameters:
-
className
StringThe class to add.
destroy
()
Destroy the widget.
domInsert
-
widget
-
element
Insert a widget in the DOM.
Parameters:
-
widget
photonui.WidgetThe widget to insert.
-
element
HTMLElementThe DOM node or its id (optional, default=Widget.e_parent)
getAllWidgets
()
Object
static
Get all instanciated PhotonUI widgets.
Returns:
An object containing all widgets {"widgetName": Widget, ...}
getWidget
-
name
Get a widget.
Parameters:
-
name
StringThe widget name.
Returns:
The widget or null.
hide
()
Hide the widget (equivalent to widget.visible = false).
registerCallback
-
id
-
wEvent
-
callback
-
thisArg
Register a callback for any PhotonUI/Widget event (called wEvent).
Callback signature:
function (Object(Base/Widget) [, arg1 [, arg2 [, ...]]])
removeClass
-
className
Remove a class from the outer HTML element of the widget.
Parameters:
-
className
StringThe class to remove.
show
()
Display the widget (equivalent to widget.visible = true).
unparent
()
Detache the widget from its parent.