Skip to content

Commit

Permalink
Add event listener and clean up image styling
Browse files Browse the repository at this point in the history
  • Loading branch information
sbinlondon committed Sep 21, 2018
1 parent 42a57d4 commit b477e2b
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 11 deletions.
9 changes: 7 additions & 2 deletions public/js/hideresultssections.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
function hideMe() {
var a = event.target.id + '-results';
function hideMe(event) {
var a;
if (event.target.nodeName == "IMG"){
var a = event.target.parentNode.id + '-results';
} else {
var a = event.target.id + '-results';
}
var elementToHide = document.getElementById(a)
elementToHide.classList.toggle('hidden');
}
Binary file not shown.
2 changes: 1 addition & 1 deletion public/stylesheets/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/stylesheets/main.css.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ img {
border: {
radius: $round-image;
}
width: $small-image;
max-height: 60vh;
max-width: 90%;
}

Expand Down
12 changes: 6 additions & 6 deletions src/views/results.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<div class='centered-column secondary-background thirtytwo-padding flex-col padding-lft'>
{{#with results}}
{{#if meetup}}
<h2 class="centered-content-no-padding padding-lft"><a id="meetup" onclick="hideMe()" tabindex="0">Meetups<img src="images/down-arrow.svg" class="down-arrow-img" alt="Down arrow to collapse section"></a></h2>
<h2 class="centered-content-no-padding padding-lft"><a id="meetup" onclick="hideMe(event)" tabindex="0">Meetups<img src="images/down-arrow.svg" class="down-arrow-img" alt="Down arrow to collapse section"></a></h2>
<div id="meetup-results">
<ul>
{{#each meetup}}
Expand All @@ -22,7 +22,7 @@
{{/if}}

{{#if article}}
<h2 class="centered-content-no-padding padding-lft"><a id="article" onclick="hideMe()" tabindex="0">Articles<img src="images/down-arrow.svg" class="down-arrow-img" alt="Down arrow to collapse section"></a></h2>
<h2 class="centered-content-no-padding padding-lft"><a id="article" onclick="hideMe(event)" tabindex="0">Articles<img src="images/down-arrow.svg" class="down-arrow-img" alt="Down arrow to collapse section"></a></h2>
<div id="article-results">
<ul>
{{#each article}}
Expand All @@ -38,7 +38,7 @@
{{/if}}

{{#if [classroom course]}}
<h2 class="centered-content-no-padding padding-lft"><a id="classroom" onclick="hideMe()" tabindex="0">Classroom courses<img src="images/down-arrow.svg" class="down-arrow-img" alt="Down arrow to collapse section"></a></h2>
<h2 class="centered-content-no-padding padding-lft"><a id="classroom" onclick="hideMe(event)" tabindex="0">Classroom courses<img src="images/down-arrow.svg" class="down-arrow-img" alt="Down arrow to collapse section"></a></h2>
<div id="classroom-results">
<ul>
{{#each [classroom course]}}
Expand All @@ -54,7 +54,7 @@
{{/if}}

{{#if [online course]}}
<h2 class="centered-content-no-padding padding-lft"><a id="online" onclick="hideMe()" tabindex="0">Online courses<img src="images/down-arrow.svg" class="down-arrow-img" alt="Down arrow to collapse section"></a></h2>
<h2 class="centered-content-no-padding padding-lft"><a id="online" onclick="hideMe(event)" tabindex="0">Online courses<img src="images/down-arrow.svg" class="down-arrow-img" alt="Down arrow to collapse section"></a></h2>
<div id="online-results">
<ul>
{{#each [online course]}}
Expand All @@ -70,7 +70,7 @@
{{/if}}

{{#if mentor}}
<h2 class="centered-content-no-padding padding-lft"><a id="people" onclick="hideMe()" tabindex="0">Inspirational people<img src="images/down-arrow.svg" class="down-arrow-img" alt="Down arrow to collapse section"></a></h2>
<h2 class="centered-content-no-padding padding-lft"><a id="people" onclick="hideMe(event)" tabindex="0">Inspirational people<img src="images/down-arrow.svg" class="down-arrow-img" alt="Down arrow to collapse section"></a></h2>
<div id="people-results">
<ul>
{{#each mentor}}
Expand All @@ -86,7 +86,7 @@
{{/if}}

{{#if others}}
<h2 class="centered-content-no-padding padding-lft"><a id="other" onclick="hideMe()" tabindex="0">Other<img src="images/down-arrow.svg" class="down-arrow-img" alt="Down arrow to collapse section"></a></h2>
<h2 class="centered-content-no-padding padding-lft"><a id="other" onclick="hideMe(event)" tabindex="0">Other<img src="images/down-arrow.svg" class="down-arrow-img" alt="Down arrow to collapse section"></a></h2>
<div id="other-results">
<ul>
{{#each others}}
Expand Down

0 comments on commit b477e2b

Please sign in to comment.