Expand all

ve.ui.AnnotationAction

Extends

Constructor

new ve.ui.AnnotationAction(surface, [source]) #

Annotation action.

Parameters:

Name Type Attributes Description
surface ve.ui.Surface

Surface to act on

source string optional
Source:
Annotation action.

Methods

clear(name, [data]) → {boolean} #

Clear an annotation.

Parameters:

Name Type Attributes Description
name string

Annotation name, for example: 'textStyle/bold'

data Object optional

Additional annotation data

Source:

Returns:

Action was executed

Type
boolean
Clear an annotation.

clearAll() → {boolean} #

Clear all annotations.

Source:

Returns:

Action was executed

Type
boolean
Clear all annotations.

set(name, [data]) → {boolean} #

Set an annotation.

Parameters:

Name Type Attributes Description
name string

Annotation name, for example: 'textStyle/bold'

data Object optional

Additional annotation data

Source:

Returns:

Action was executed

Type
boolean
Set an annotation.

setInternal(name, [data]) → {boolean}private #

Internal implementation of set(). Do not use this, use set() instead.

Parameters:

Name Type Attributes Description
name string

Annotation name, for example: 'textStyle/bold'

data Object optional

Additional annotation data

Source:

Returns:

Action was executed

Type
boolean
Internal implementation of set().

toggle(name, [data]) → {boolean} #

Toggle an annotation.

If the selected text is completely covered with the annotation already the annotation will be cleared. Otherwise the annotation will be set.

Parameters:

Name Type Attributes Description
name string

Annotation name, for example: 'textStyle/bold'

data Object optional

Additional annotation data

Source:

Returns:

Action was executed

Type
boolean
Toggle an annotation.