Home Reference Source
import PostVoteViewController from '~/controllers/PostVoteViewController.js'
public class | source

PostVoteViewController

Extends:

ViewControllerVoteViewController → PostVoteViewController

Voting on answers

Constructor Summary

Public Constructor
public

constructor(voteButton: HTMLElement, opts: Object)

Creates an answer view controller

Method Summary

Public Methods
public

Inherited Summary

From class ViewController
public static

forClass(className: string, predicate: Function, root: HTMLElement)

Creates a view controller directly for all members of a class.

public static

of(elem: string | Element): ViewController

Returns a canolical VC of an element if it exists

From class VoteViewController
public abstract

getRequest(voteType: string, status: boolean): Request

Returns a vote request for the data

public

Sets the loading state

public

async setVote(status: boolean)

What to set vote too.

public

Sets vote activity

public

Sets the vote total

public

Toggles vote controller value.

Public Constructors

public constructor(voteButton: HTMLElement, opts: Object) source

Creates an answer view controller

Override:

VoteViewController#constructor

Params:

NameTypeAttributeDescription
voteButton HTMLElement
opts Object
opts.voteType string
opts.postId number

Public Methods

public getRequest() source

Returns a vote request for the data

Override:

VoteViewController#getRequest