FollowButtonController
Extends:
Creates a follow button. Expects an 'SVG' subelement for icon and a 'span' element child to contain follow/unfollow text. This uses the button classes (.button-active) in the active state.
Constructor Summary
Public Constructor | ||
public |
constructor(buttonNode: HTMLElement, auth: Auth, user: User) Sets up follow button with button node and user. |
Member Summary
Public Members | ||
public |
The icon |
|
public |
The label |
|
public |
node: HTMLElement The node |
|
public |
The user which this will follow |
Method Summary
Public Methods | ||
public |
async follow() Followers a user |
|
public |
async toggle() Toggles if following or not |
|
public |
async unfollow() Unfollowers a user |
Inherited Summary
From class ViewController | ||
public static |
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 |
Public Constructors
public constructor(buttonNode: HTMLElement, auth: Auth, user: User) source
Sets up follow button with button node and user.