From e62375516bb8aa5a65bb46a912c6d907ad144478 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Thu, 8 Oct 2015 17:00:15 -0700 Subject: [PATCH] Add commit button functionality --- server/views/commit/index.jade | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/server/views/commit/index.jade b/server/views/commit/index.jade index e1f3d915fc2..876eb813629 100644 --- a/server/views/commit/index.jade +++ b/server/views/commit/index.jade @@ -52,28 +52,38 @@ block content h3 Step 3: Set up your monthly donation .row .col-xs-12.col-sm-6.col-sm-offset-3.text-center - a.btn.btn-block.btn-lg.btn-primary(href=donateUrl target='_blank') Open the #{displayName} donation page + a#commit-btn-donate.btn.btn-block.btn-lg.btn-primary(href=donateUrl target='_blank') Open the #{displayName} donation page .spacer .col-xs-12.col-sm-6.col-sm-offset-3 - h3 Step 4: Confirm your commitment to your goal + h3#commit-step4-text.disabled + Step 4: Confirm + span#commit-step4-hidden.disabled (Do step 3 first) + span#commit-step4-show.hidden your commitment to your goal .row .col-xs-12.col-sm-6.col-sm-offset-3.text-center - a#commit-btn-submit.btn.btn-block.btn-lg.signup-btn(href=donateUrl target='_blank') Commit + button#commit-btn-submit.btn.btn-block.btn-lg.btn-primary.disabled Commit if pledge form.row(name='stop-pledge' action='/commit/stop-commitment' method='post') .col-xs-12.col-sm-6.col-sm-offset-3.text-center .button-spacer - button.btn.btn-block.btn-danger(name='submit' type='submit') Stop my current pledge + button.btn.btn-block.btn-lg.btn-default(name='submit' type='submit') Stop my current pledge else .row .col-xs-12.col-sm-6.col-sm-offset-3.text-center .button-spacer - a.btn.btn-block.btn-default(href='/map') Maybe later + a.btn.btn-block.btn-lg.btn-default(href='/map') Maybe later .spacer script. $(function() { + $('#commit-btn-donate').click(function() { + $('#commit-btn-submit').removeClass('disabled'); + $('#commit-step4-text').removeClass('disabled'); + $('#commit-step4-hidden').hide(); + $('#commit-step4-show').removeClass('hidden'); + }); + $('#commit-btn-submit').click(function() { window.location.href = '/commit/pledge?' + $('form').serialize(); });