File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * Gravity Perks // Advanced Select // Caret Position
3
+ * https://gravitywiz.com/documentation/gravity-forms-advanced-select/
4
+ *
5
+ * Adds Caret Position to GP Advanced Select fields.
6
+ *
7
+ * The Caret Position is a built in plugin of Tom Select.
8
+ * @reference https://tom-select.js.org/plugins/caret-position/
9
+ *
10
+ * Instructions:
11
+ *
12
+ * 1. Install this snippet with our free Custom JavaScript plugin.
13
+ * https://gravitywiz.com/gravity-forms-code-chest/
14
+ */
15
+ window . gform . addFilter (
16
+ 'gpadvs_settings' ,
17
+ function ( settings , gpadvsInstance , selectNamespace ) {
18
+ /**
19
+ * Scope to only multiselect fields.
20
+ */
21
+ if ( gpadvsInstance . fieldType === 'multiselect' ) {
22
+ settings . plugins . caret_position = {
23
+ title : 'Caret Position' ,
24
+ } ;
25
+ settings . plugins . input_autogrow = {
26
+ title : 'Input Autogrow' ,
27
+ } ;
28
+ }
29
+
30
+ return settings ;
31
+ }
32
+ ) ;
You can’t perform that action at this time.
0 commit comments