Skip to content
This repository has been archived by the owner on Apr 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request nss-day-cohort-47#26 from nss-day-cohort-47/cm-fix…
Browse files Browse the repository at this point in the history
…-save-button-enable-disable-feature

added save disabling rather than hiding, fixed save errors
  • Loading branch information
coltmay authored Mar 19, 2021
2 parents afd8d61 + b27e1bb commit 03454c7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 24 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ <h1>Itinerary Preview</h2>
<h3>Your Trip awaits</h3>
</aside>
<footer>
<!-- ! FOOTER -->
<button id="saveItinerary">Save Itinerary</button>
</footer>
<script type="module" src="/scripts/main.js"></script>
</body>
Expand Down
19 changes: 3 additions & 16 deletions scripts/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ import { displayPark, showParkDetails } from "./parks/ParkPreview.js"
import { itineraryList } from "./itinerary/ItineraryList.js";
import { createItinerary } from "./data/DataManager.js";

import { displaySave } from "./nav/Footer.js";

// Set Application For Event Bubbling
const applicationElement = document.querySelector("body");
document.getElementById("saveItinerary").disabled = true;

// Event Listener To Test Capture of All Previewed Locations
const saveItinerary = () => {
Expand All @@ -39,8 +38,8 @@ const saveItinerary = () => {
parkPreviewLocation: parkPreviewLocation
};
createItinerary(itineraryObject);
location.reload();
}

})
}

Expand Down Expand Up @@ -106,17 +105,6 @@ parkDetailElement.addEventListener("click", (event) => {
}
})

/*~~~~~~~~~~~~~~~Test Code~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
// const contentElement = document.querySelector("body");
// contentElement.addEventListener("click", event => {
// if (event.target.id === "")
// console.log(event.target.id)
// })


/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
//? Drop Down Population

// Display Save Button When Three Selections Are Made
Expand All @@ -125,7 +113,7 @@ const saveCheck = () => {
const attractionContainer = document.querySelector(".attractionCard");
const eateryContainer = document.querySelector(".eateryCard");
if (!(parkContainer.innerHTML === "" || attractionContainer.innerHTML === "" || eateryContainer.innerHTML === "")) {
displaySave();
document.getElementById("saveItinerary").disabled = false;
}
}

Expand All @@ -137,7 +125,6 @@ eateryDetailElement.addEventListener("click", (event) => {
for (let anEatery of eateryListArray) {
// Although value is a number, it is presented as a string in EateryPreview.js / parseInt converts it to an integer
if (anEatery.id === parseInt(event.target.value)) {

showEateryDetails(anEatery)
}
}
Expand Down
7 changes: 0 additions & 7 deletions scripts/nav/Footer.js

This file was deleted.

0 comments on commit 03454c7

Please sign in to comment.