work finished through 2b on exercise checklist

main
Jason 3 years ago
parent b18ee4e062
commit 8673a7fdad

@ -19,11 +19,8 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Hack or Snooze</title> <title>Hack or Snooze</title>
<link <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
rel="stylesheet" integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU" crossorigin="anonymous">
href="https://use.fontawesome.com/releases/v5.3.1/css/all.css"
integrity="sha384-mzrmE5qonljUremFsqc01SB46JvROS7bZs3IO2EmfFsd15uHvIt+Y8vEf7N7fWAU"
crossorigin="anonymous">
<link rel="stylesheet" href="css/site.css"> <link rel="stylesheet" href="css/site.css">
<link rel="stylesheet" href="css/user.css"> <link rel="stylesheet" href="css/user.css">
<link rel="stylesheet" href="css/stories.css"> <link rel="stylesheet" href="css/stories.css">
@ -58,9 +55,10 @@
</section> </section>
<!-- Login and signup forms --> <!-- Login and signup and add story forms -->
<section class="account-forms-container container"> <section class="account-forms-container container">
<!--add story form-->
<form id="add-story-form" class="add-story hidden"> <form id="add-story-form" class="add-story hidden">
<h4>Add a story</h4> <h4>Add a story</h4>
<label for="story-title">Title: </label> <label for="story-title">Title: </label>
@ -117,4 +115,5 @@
<script src="js/stories.js"></script> <script src="js/stories.js"></script>
</body> </body>
</html> </html>

@ -73,13 +73,17 @@ async function getNewStoryAndSubmit(evt) {
title: title, title: title,
author: author, author: author,
url: url url: url
} };
// instantiate a Story with obj and display on page // instantiate a Story with obj and display on page
const resultOfAddStoryCall = await storyList.addStory(currentUser, newStory); const resultOfAddStoryCall = await storyList.addStory(currentUser, newStory);
console.log("resultOfAddStoryCall: ", resultOfAddStoryCall); console.log("resultOfAddStoryCall: ", resultOfAddStoryCall);
hidePageComponents(); hidePageComponents();
putStoriesOnPage(); await getAndShowStoriesOnStart();
//resets form with empty values
$addStoryForm.trigger("reset");
} }
//event listener for add story form submit
$addStoryForm.on("submit", getNewStoryAndSubmit); $addStoryForm.on("submit", getNewStoryAndSubmit);
Loading…
Cancel
Save