hide desc on complete campaign; add toggle link

This commit is contained in:
Matchu 2015-09-26 13:17:36 -07:00
parent 4ae43f61ea
commit b953e572a3
3 changed files with 30 additions and 3 deletions

View file

@ -33,4 +33,15 @@
}
}
});
var toggle = document.getElementById('success-thanks-toggle-description');
toggle.addEventListener('click', function() {
var desc = document.getElementById('description');
var attr = 'data-show';
if (desc.hasAttribute(attr)) {
desc.removeAttribute(attr);
} else {
desc.setAttribute(attr, true);
}
});
})();

View file

@ -79,14 +79,27 @@ body.campaigns-show, body.campaigns-current
button
+loud-awesome-button-color
#campaign-text[data-campaign-complete]
#description
display: none
&[data-show]
display: block
#success-thanks
border: 1px dashed $module-border-color
margin-bottom: 1em
padding: 1em
position: relative
p:last-child
margin-bottom: 0
#success-thanks-toggle-description
position: absolute
bottom: 1em
font-style: italic
right: 1em
#outfits
+outfits-list
text-align: center

View file

@ -26,9 +26,12 @@
= text_field_tag 'donation[amount]', '10.00'
%button{:type => 'submit'} Donate now!
- if @campaign.complete? && @campaign.thanks?
#success-thanks= emote_md @campaign.thanks
#description= emote_md @campaign.description
#campaign-text{'data-campaign-complete' => @campaign.complete?}
- if @campaign.complete? && @campaign.thanks?
#success-thanks
#success-thanks-main= emote_md @campaign.thanks
%a#success-thanks-toggle-description{href: '#'} How are donations used?
#description= emote_md @campaign.description
- if @donations.present?
%h2 Thanks to our lovely donors!