Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
55d1c34b1f | ||
|
|
565ee0a352 | ||
|
|
a41ad107a1 |
No files matched your search
@@ -1,4 +1,4 @@
|
||||
.sg-donate{max-width:min(100%,440px);font:inherit}
|
||||
.sg-donate{width:100%;max-width:min(100%,440px);margin-left:auto;margin-right:auto;box-sizing:border-box;text-align:left;font:inherit}
|
||||
.sg-donate .sg-row{margin:0 0 .9rem}
|
||||
.sg-donate label{display:block;font-weight:600;margin-bottom:.25rem}
|
||||
.sg-donate label.sg-inline{display:flex;gap:.5rem;align-items:center;font-weight:400}
|
||||
@@ -53,3 +53,7 @@
|
||||
.sg-donate .sg-progress [hidden]{display:none}
|
||||
.sg-donate.sg-progress-only .sg-progress{margin-bottom:0}
|
||||
@media (prefers-reduced-motion:reduce){.sg-donate .sg-progress-fill{transition:none}}
|
||||
.sg-donate .sg-thanks{margin:.5rem 0 0;padding:1.1rem 1rem;border:1px solid rgba(26,127,55,.55);border-left-width:4px;border-radius:.4rem;text-align:center}
|
||||
.sg-donate .sg-thanks:focus{outline:0}
|
||||
.sg-donate .sg-thanks-title{margin:0;font-size:1.15em;font-weight:700;line-height:1.4;overflow-wrap:anywhere}
|
||||
.sg-donate [hidden]{display:none!important}
|
||||
+14
-1
@@ -262,6 +262,18 @@
|
||||
};
|
||||
}
|
||||
|
||||
// Replace the form with a confirmation (keeps the progress bar). No way back until the page is reloaded,
|
||||
// so the donor does not pay twice thinking it failed.
|
||||
function showThanks(text) {
|
||||
state.renderToken++;
|
||||
Array.prototype.forEach.call(root.children, function (n) { if (n !== barBox) { n.hidden = true; } });
|
||||
var panel = el('div', { 'class': 'sg-thanks', role: 'status', tabindex: '-1' }, [
|
||||
el('p', { 'class': 'sg-thanks-title', text: text })
|
||||
]);
|
||||
root.appendChild(panel);
|
||||
try { panel.focus(); panel.scrollIntoView({ block: 'nearest', behavior: 'smooth' }); } catch (e) { /* ignore */ }
|
||||
}
|
||||
|
||||
function renderButtons() {
|
||||
var token = ++state.renderToken;
|
||||
buttons.textContent = '';
|
||||
@@ -277,7 +289,8 @@
|
||||
},
|
||||
onApprove: function (data) {
|
||||
return api('/orders/' + encodeURIComponent(data.orderID) + '/capture', { method: 'POST' }).then(function (r) {
|
||||
say(r.status === 'completed' ? T.thanks : T.processing, 'sg-ok');
|
||||
say('');
|
||||
showThanks(r.status === 'completed' ? T.thanks : T.processing);
|
||||
afterDonation();
|
||||
});
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user