Class Jelo.Widget


Defined in: Jelo.Widget.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Creates a new basic Widget.
Field Summary
Field Attributes Field Name and Description
<constant>  
Not typically used, but may come in useful if your code needs to make sure it is acting on a Jelo.Widget.
Method Summary
Method Attributes Method Name and Description
 
Attempts to remove this widget from the current page.
 
Disables the widget.
 
Enables the widget.
 
render(parent)
Adds the element to the current page.
Class Detail
Jelo.Widget()
Creates a new basic Widget. This is typically only used as follows:
    Jelo.mold('MyNewWidget', function() {
        this.dom = Jelo.Dom.fromString('<h1>My New Widget</h1>');
    });
    Jelo.MyNewWidget.prototype = new Jelo.Widget(); // inherit common functionality
Widgets have a private HTMLElement property, dom, that should be considered a "protected property" - that is, external objects should only be able to manipulate a Widget's dom by using that widget's public methods. Those public methods can then access this.dom. This is not a rule, but it is a strong suggestion.
Field Detail
<constant> {Boolean} isWidget
Not typically used, but may come in useful if your code needs to make sure it is acting on a Jelo.Widget.
Method Detail
{Boolean} destroy()
Attempts to remove this widget from the current page.
Returns:
{Boolean} True if successful, false if not. This return value can be safely ignored.

disable()
Disables the widget. By default, it only adds the class "unselectable" so that you can decide what behavior that implies.

enable()
Enables the widget. By default, it only removes the class "unselectable" so that you can decide what behavior that implies.

render(parent)
Adds the element to the current page.
Parameters:
{HTMLElement} parent Optional, Default: document.body
The node to which this widget will be rendered.


recent changes — (see all)
random jelo shots — (see all)