Skip to content

Commit 8d2af88

Browse files
committed
add onCaptchaRendered example action in dummy app
1 parent 5abca4e commit 8d2af88

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

tests/dummy/app/mixins/actions-mixin.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import Mixin from '@ember/object/mixin';
22

33
export default Mixin.create({
4+
45
actions: {
6+
7+
onCaptchaRendered() {
8+
console.info('reCaptcha just rendered');
9+
},
10+
511
onCaptchaResolved(reCaptchaResponse) {
612
window.swal(
713
'reCaptcha successfully resolved!',
@@ -10,6 +16,7 @@ export default Mixin.create({
1016
);
1117
console.info('reCaptcha response:\n'+reCaptchaResponse);
1218
},
19+
1320
onCaptchaExpired() {
1421
window.swal({
1522
title: 'reCaptcha response expired!',
@@ -18,8 +25,10 @@ export default Mixin.create({
1825
this.transitionToRoute('index');
1926
});
2027
},
28+
2129
forceReset() {
2230
this.get('gRecaptcha').resetReCaptcha();
2331
}
2432
}
33+
2534
});
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
<h2>Google Defaults</h2>
2-
{{g-recaptcha onSuccess=(action "onCaptchaResolved") ref=(mut gRecaptcha) }}
2+
{{g-recaptcha
3+
onRender=(action "onCaptchaRendered")
4+
onSuccess=(action "onCaptchaResolved")
5+
ref=(mut gRecaptcha)
6+
}}
37
<p><a href="" {{action "forceReset"}}>Force reset</a></p>

0 commit comments

Comments
 (0)