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 button
+loud-awesome-button-color +loud-awesome-button-color
#campaign-text[data-campaign-complete]
#description
display: none
&[data-show]
display: block
#success-thanks #success-thanks
border: 1px dashed $module-border-color border: 1px dashed $module-border-color
margin-bottom: 1em margin-bottom: 1em
padding: 1em padding: 1em
position: relative
p:last-child p:last-child
margin-bottom: 0 margin-bottom: 0
#success-thanks-toggle-description
position: absolute
bottom: 1em
font-style: italic
right: 1em
#outfits #outfits
+outfits-list +outfits-list
text-align: center text-align: center

View file

@ -26,8 +26,11 @@
= text_field_tag 'donation[amount]', '10.00' = text_field_tag 'donation[amount]', '10.00'
%button{:type => 'submit'} Donate now! %button{:type => 'submit'} Donate now!
#campaign-text{'data-campaign-complete' => @campaign.complete?}
- if @campaign.complete? && @campaign.thanks? - if @campaign.complete? && @campaign.thanks?
#success-thanks= emote_md @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 #description= emote_md @campaign.description
- if @donations.present? - if @donations.present?