Syntax.js - Documentation - Binding Options - Custom Triggers

Below is a list of all the binding options custom triggers supported in Syntax.js, which are fired when specific actions occur.

Download Now

v2.5.0 - 29th Mar 2024
Option Triggers

For Rendering:

options.onBeforeRenderComplete( element ):

Fires before the rendering of the syntax of an element.
Parameter: element: object - The DOM element that is going to be rendered.

options.onRenderComplete( element ):

Fires when the rendering of the syntax for an element is complete.
Parameter: element: object - The DOM element that was rendered.

options.onKeywordRender( keyword ):

Fires when a keyword is rendered.
Parameter: keyword: string - The keyword that was rendered.

options.onValueRender( value ):

Fires when a value is rendered.
Parameter: value: string - The value that was rendered.

options.onAttributeRender( attribute ):

Fires when a attribute is rendered.
Parameter: attribute: string - The attribute that was rendered.

options.onStringRender( string ):

Fires when a string is rendered.
Parameter: string: string - The string that was rendered.

options.onCommentRender( comment ):

Fires when a comment is rendered.
Parameter: comment: string - The comment that was rendered.


For Code:

options.onCopy( code ):

Fires when the "Copy" button is pressed.
Parameter: code: string - The string that was copied to the clipboard.

options.onKeywordClicked( keyword ):

Fires when a keyword is clicked in the code syntax.
Parameter: keyword: string - The keyword that was clicked.

options.onValueClicked( value ):

Fires when a value is clicked in the code syntax.
Parameter: value: string - The value that was clicked.

options.onAttributeClicked( attribute ):

Fires when a attribute is clicked in the code syntax.
Parameter: attribute: string - The attribute that was clicked.

options.onPrint( code ):

Fires when the "Print" button is pressed.
Parameter: code: string - The string that was sent to the printer.


For Buttons:

options.onButtonsClosed():

Fires when the buttons are closed.

options.onButtonsOpened():

Fires when the buttons are opened.