Exemple #1
0
Row.prototype.setClickHandler = function(value)
{
    if (this.setClickHandler != null)
        Prolog._free_local(this.setClickHandler);
    if (ReactComponent.isNull(value))
    {
        if (this.domNode.onClick !== undefined)
            this.domNode.onClick = undefined;
        return;
    }
    this.clickHandler = Prolog._make_local(value);
    this.domNode.onclick = clickHandler.bind(this);
}
Exemple #2
0
Frame.prototype.setProperties = function(t)
{
    ReactComponent.prototype.setProperties.call(this, t);
    if (t.z_index !== undefined)
    {
        this.z = ReactComponent.numericValueOr(t.z_index, 0);
        this.setZ();
    }
    if (t.scroll !== undefined)
    {
        if (ReactComponent.isNull(t.scroll))
            this.baseClassName = "proactive_container";
        else if (Prolog._portray(t.scroll) == "both")
            this.baseClassName = "proactive_container scrollpane scroll";
        else if (Prolog._portray(t.scroll) == "horizontal")
            this.baseClassName = "proactive_container scrollpane scrollx";
        else if (Prolog._portray(t.scroll) == "vertical")
            this.baseClassName = "proactive_container scrollpane scrolly";
        this.restyle();
    }
    if (t.scroll !== undefined ||
        t.layout !== undefined ||
        t.fill !== undefined ||
        t["align-children"] !== undefined ||
        t["justify-content"] !== undefined)
    {
        this.contentPane.className = "proactive_frame_contentpane proactive_container " + this.getStyle();
    }
    if (t.onKeyDown !== undefined)
    {
        if (this.keyDownHandler != null)
            Prolog._free_local(this.keyDownHandler);
        if (ReactComponent.isNull(t.onKeyDown))
            this.keyDownHandler = null;
        else
            this.keyDownHandler = Prolog._make_local(t.onKeyDown);
    }
}
Exemple #3
0
Field.prototype.setProperties = function(t)
{
    ReactComponent.prototype.setProperties.call(this, t);
    if (t.type !== undefined)
    {
        var newType;
        if (ReactComponent.isNull(t.type))
            newType = "text";
        else
            newType = Prolog._atom_chars(t.type);
        if (newType != this.type)
        {
            this.type = newType;
            this.domNode.type = this.type;
            this.setValue(this.value);
        }
    }
    if (t.value !== undefined)
    {
        if (ReactComponent.isNull(t.value))
            this.value = '';
        else
            this.value = Prolog._atom_chars(t.value);
        this.setValue(this.value);
        if (this.proposedCaretPosition != null && this.value.length >= this.proposedCaretPosition)
            this.domNode.setSelectionRange(this.proposedCaretPosition, this.proposedCaretPosition);
    }
    // Reset this between events
    this.proposedCaretPosition = null;
    if (t.disabled !== undefined)
    {
        this.domNode.disabled = ReactComponent.booleanValue(t.disabled);
    }
    if (t.onBlur !== undefined)
    {
        if (this.blurHandler != null)
            Prolog._free_local(this.blurHandler);
        if (ReactComponent.isNull(t.onBlur))
            this.blurHandler = null;
        else
            this.blurHandler = Prolog._make_local(t.onBlur);
    }
    if (t.verifyValue !== undefined)
    {
        if (this.verifyValue != null)
            Prolog._free_local(this.verifyValue);
        if (ReactComponent.isNull(t.verifyValue))
            this.verifyValue = null;
        else
            this.verifyValue = Prolog._make_local(t.verifyValue);
    }
    if (t.onChange !== undefined)
    {
        if (this.changeHandler != null)
            Prolog._free_local(this.changeHandler);
        if (ReactComponent.isNull(t.onChange))
            this.changeHandler = null;
        else
            this.changeHandler = Prolog._make_local(t.onChange);
    }
    if (t.align !== undefined)
    {
        this.domNode.style["text-align"] = Prolog._atom_chars(t.align);
    }
    if (t.title !== undefined)
    {
        if (ReactComponent.isNull(t.title))
            this.domNode.title = "";
        else
            this.domNode.title = Prolog._atom_chars(t.title);
    }

}