CommentFormOperationRegistry

CommentFormOperationRegistry

Class representing an operation registry, a storage of operations that a comment form currently undergoes, such as 'load' or 'submit'.

Constructor

new CommentFormOperationRegistry(commentForm)

Source:

Create an operation registry.

Parameters:
Name Type Description
commentForm CommentForm

Methods

add(type, optionsopt, clearMessagesopt) → {CommentFormOperation}

Source:

Add an operation to the registry.

Parameters:
Name Type Attributes Default Description
type 'load' | 'preview' | 'viewChanges' | 'submit'
options object <optional>
{}
clearMessages boolean <optional>
true

Whether to clear messages above the comment form.

Returns:
Type
CommentFormOperation

areThere(type) → {boolean}

Source:

Check if there are operations of the specified type in the registry.

Parameters:
Name Type Description
type 'load' | 'preview' | 'viewChanges' | 'submit'

Operation type.

Returns:
Type
boolean

closeAll()

Source:

Close all registered operations.

filter(callback) → {Array.<CommentFormOperation>}

Source:

Find operations for which the specified callback returns a truthy value.

Parameters:
Name Type Description
callback function
Returns:
Type
Array.<CommentFormOperation>

filterByType(type) → {Array.<CommentFormOperation>}

Source:

Find operations of the specified type in the registry.

Parameters:
Name Type Description
type 'load' | 'preview' | 'viewChanges' | 'submit'

Operation type.

Returns:
Type
Array.<CommentFormOperation>

remove(operation)

Source:

Remove an operation from the registry.

Parameters:
Name Type Description
operation CommentFormOperation