Skip to content

Commit 100adf9

Browse files
committed
added Google reCaptcha size parameter
(attribute) data-validation-recaptcha-size="compact|normal" (config) reCaptchaSize: "compact|normal"
1 parent 40ea48c commit 100adf9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/modules/security.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,8 @@
546546
var $input = $(this),
547547
div = document.createElement('DIV'),
548548
siteKey = config.reCaptchaSiteKey || $input.valAttr('recaptcha-sitekey'),
549-
theme = config.reCaptchaTheme || $input.valAttr('recaptcha-theme') || 'light';
549+
theme = config.reCaptchaTheme || $input.valAttr('recaptcha-theme') || 'light',
550+
size = config.reCaptchaSize || $input.valAttr('recaptcha-size') || 'normal';
550551

551552
if (!siteKey) {
552553
throw new Error('Google reCaptcha site key is required.');
@@ -563,6 +564,7 @@
563564
var widgetId = grecaptcha.render(div, {
564565
sitekey: siteKey,
565566
theme: theme,
567+
size: size,
566568
callback: grecaptchaRenderCallback,
567569
'expired-callback': grecaptchaRenderCallback
568570
});

0 commit comments

Comments
 (0)