Skip to content

Comments

CP Project Cinema#17

Open
chrisphillers wants to merge 8 commits intoconstructorlabs:masterfrom
chrisphillers:master
Open

CP Project Cinema#17
chrisphillers wants to merge 8 commits intoconstructorlabs:masterfrom
chrisphillers:master

Conversation

@chrisphillers
Copy link

First commit


searchFunc.addEventListener("submit", function(event) {
event.preventDefault();
console.log(event.target['0'].value);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get the input value using query selector rather than index of the form. It will make the code more robust and less likely to break in future if we move elements around


//Search result function / index of links/li's

function IMDBData(search) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functions names should not start with capital letters as they are reserved for constructors. Also, function name should better indicate what it does rather than be a noun

function IMDBData(search) {
// console.log(search.Search[4].Poster);

search.Search.map((movies) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be a forEach as it does not return anything

fetchTrailer(trailerURL);
let imdbID = movies.imdbID;
// defunct function to push more info next to relevant film
// imdbInfo(imdbID)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented out code can be removed

if (search.Response === 'False') {
parentSearchResult.innerHTML = "";
console.log(search)
notFound();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

.then(function(result){

// If unknown result
if (result.Response === 'False') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good use of response checking


function movieMore(finder){

//defunct attempt at inserting more info to right of relevant film div
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commented code should be removed as it just adds clutter

}


.results img{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would better handled using BEM class based selectors

@dmitrigrabov
Copy link
Collaborator

Would love to see an updated README that explains the project

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants