Thread

Thread

Class representing a comment thread object.

Constructor

new Thread(rootComment)

Source:

Create a comment thread object.

Parameters:
Name Type Description
rootComment Comment

Root comment of the thread.

Members

$expandNote :external:jQuery|undefined

Source:

Note in place of a collapsed thread that has a button to expand the thread.

Type:

isCollapsed :boolean

Source:

Is the thread collapsed.

Type:
  • boolean

Methods

(static) init(autocollapseopt)

Source:

Create threads. Can be re-run if DOM elements are replaced.

Parameters:
Name Type Attributes Default Description
autocollapse boolean <optional>
true

Autocollapse threads according to the settings and restore collapsed threads from the local storage.

(static) initPrototypes()

Source:

For internal use. Create element prototypes to reuse them instead of creating new elements from scratch (which is more expensive).

(static) updateLines()

Source:

For internal use. Calculate the offset and (if needed) add the thread lines to the container.

collapse(loadUserGendersPromiseopt, autoopt)

Source:

Collapse the thread.

Parameters:
Name Type Attributes Default Description
loadUserGendersPromise Promise.<undefined> <optional>
auto boolean <optional>
false

Automatic collapse - don't scroll anywhere and don't save collapsed threads.

expand(autoopt)

Source:

Expand the thread.

Parameters:
Name Type Attributes Default Description
auto boolean <optional>
false