Class: expansionView

expansionView()

Handle's the rendering of the expansion page when user clicked a movie/tv show card.

Constructor

new expansionView()

Source:

Methods

_addBtnListeners()

Add Event Listeners for Watch trailer button and close video button.

Source:

_clearHTML()

Clears the parent element's HTML.

Source:

_createCastCircle(castData, showAllButton, limitCasts)

Generates cast circles for the movie/tv show that has been expanded.

Parameters:
Name Type Default Description
castData Array

Contains all the data about the casts of the movie/tv show.

showAllButton Boolean false

If the show all button would be rendered or not.

limitCasts Boolean false

Limits the generated cast HTML's.

Source:
Returns:

Cast circles markup HTML to be rendered in the page.

_createGenreTags(genreData)

Generate genre tags for the movie/tv show that has been expanded.

Parameters:
Name Type Description
genreData Array

Array of objects that contains the movie/tv show genre data's.

Source:
Returns:

Genre tags markup HTML to be rendered in the page.

_generateHTML(bookmarked)

Generates the HTML for the expansion page when a movie/tv card has been clicked.

Parameters:
Name Type Description
bookmarked boolean

bookmarked movie or not

Source:

_showAllCasts()

Generates all casts section and render it in the page.

Source:

addEventHandler(handle)

Listens to event when bookmark button has been clicked.

Parameters:
Name Type Description
handle function

the function that controls the button functionality.

Source:

renderHTML(videoData, videoDetails, videoCasts, bookmarked)

Renders the expanded movie or tv show page.

Parameters:
Name Type Description
videoData Array

Array of objects that contains the key to fetch the video from youtube

videoDetails Object

Contains all the data about the expanded movie/tv show

videoCasts Array

Contains all the data about the casts of the movie/tv show

bookmarked boolean

bookmarked movie or not

Source:

renderLoading()

Renders loading spinner in the page.

Source:

scrollToTop()

Scrolls the view to the very top of the page.

Source: