Skip to content

DisplaySwitch

Description

Display switch for the Comments plugin. Manages the time of delayed displaying / hiding comments.

Description

Initializes the display switch and configures the debounced show delay.

Members

hidingTimer

Source code

displaySwitch.hidingTimer : number

Reference to timer, run by setTimeout, which is hiding comment.

showDebounced

Source code

displaySwitch.showDebounced : function

Show comment after predefined delay. It keeps reference to immutable debounce function.

wasLastActionShow

Source code

displaySwitch.wasLastActionShow : boolean

Flag to determine if comment can be showed or hidden. State true mean that last performed action was an attempt to show comment element. State false mean that it was attempt to hide comment element.

Methods

cancelHiding

Source code

displaySwitch.cancelHiding()

Cancel hiding comment.

destroy

Source code

displaySwitch.destroy()

Destroy the switcher.

hide

Source code

displaySwitch.hide()

Responsible for hiding comment after proper delay.

show

Source code

displaySwitch.show(range)

Responsible for showing comment after proper delay.

ParamTypeDescription
rangeobjectCoordinates of selected cell.

updateDelay

Source code

displaySwitch.updateDelay(displayDelay)

Update the switch settings.

ParamTypeDescription
displayDelaynumberDelay of showing the comments (in milliseconds).