blockly > browserEvents > conditionalBind

browserEvents.conditionalBind() function

Bind an event handler that can be ignored if it is not part of the active touch stream. Use this for events that either start or continue a multi-part gesture (e.g. mousedown or mousemove, which may be part of a drag or click).


export declare function conditionalBind(node: EventTarget, name: string, thisObject: Object | null, func: Function, opt_noCaptureIdentifier?: boolean): Data;


Parameter Type Description
node EventTarget Node upon which to listen.
name string Event name to listen to (e.g. 'mousedown').
thisObject Object | null The value of 'this' in the function.
func Function Function to call when event is triggered.
opt_noCaptureIdentifier boolean (Optional) True if triggering on this event should not block execution of other event handlers on this touch or other simultaneous touches. False by default.



Opaque data that can be passed to unbindEvent_.