Skip to content
This repository was archived by the owner on Jan 12, 2022. It is now read-only.

Commit 980abb9

Browse files
mohsen1369himiklab
authored andcommitted
Issue invisible (#63)
* Add invisible featured
1 parent 7f40838 commit 980abb9

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Diff for: ReCaptcha.php

+6-1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ class ReCaptcha extends InputWidget
5050

5151
const SIZE_NORMAL = 'normal';
5252
const SIZE_COMPACT = 'compact';
53+
const SIZE_INVISIBLE = 'invisible';
5354

5455
/** @var string Your sitekey. */
5556
public $siteKey;
@@ -63,7 +64,7 @@ class ReCaptcha extends InputWidget
6364
/** @var string The type of CAPTCHA to serve. [[TYPE_IMAGE]] (default) or [[TYPE_AUDIO]] */
6465
public $type;
6566

66-
/** @var string The size of the widget. [[SIZE_NORMAL]] (default) or [[SIZE_COMPACT]] */
67+
/** @var string The size of the widget. [[SIZE_NORMAL]] (default) or [[SIZE_COMPACT]] or [[SIZE_INVISIBLE]] */
6768
public $size;
6869

6970
/** @var integer The tabindex of the widget */
@@ -142,6 +143,10 @@ public function run()
142143
},
143144
});
144145
reCaptcha.data("recaptcha-client-id", recaptchaClientId);
146+
147+
if (reCaptcha.data("size") === "invisible") {
148+
grecaptcha.execute(recaptchaClientId);
149+
}
145150
}
146151
});
147152
};

0 commit comments

Comments
 (0)