behavior:clickable

behavior:clickable

Clickable non-focusable element. Lightweight button if you wish that generates BUTTON_CLICK events on MOUSE_DOWN/UP events.

Elements

These elements have behavior:button applied by default:

  • <toolbar><button></button></toolbar>

Attributes

N/A

Events

Other than standard set of mouse event the behavior:clickable generates:

  • BUTTON_CLICK event, generated on mouse down/up or spacebar key press events when button is in focus. Posted (asynchronous) event.
  • BUTTON_PRESS event, generated on mouse down or spacebar key down when button is in focus. Synchronous event.

Methods

N/A – behavior:button does not introduce any specific methods.

Value

N/A

Button clicks handling in script

raw onClick handler

var btn = $(button#some);
btn.onClick = function() { ... event handling code ... }

on() subscription

var btn = $(button#some);
btn.on("click", function() { ... event handling code ... });
self.on("click", "button#some", function() { ... event handling code ... });

decorators.tis handler

include "decorators.tis";
@click @on "button#some" :: ... event handling code ...;