File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * Gravity Perks // GP File Upload Pro // Prevent cropper from closing Beaver Builder modal that a form is embedded in
3+ * https://gravitywiz.com/documentation/gravity-forms-file-upload-pro/
4+ *
5+ * Experimental Snippet 🧪
6+ *
7+ * Instructions:
8+ * 1. Install our free Custom JavaScript for Gravity Forms plugin.
9+ * Download the plugin here: https://gravitywiz.com/gravity-forms-code-chest/
10+ * 2. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin.
11+ * 3. Update the form ID/field ID (e.g. GPFUP_24_1) and Beaver Builder modal ID (e.g. pp_modal_fl6amr4d57jn) accordingly.
12+ */
13+ gform . addAction ( 'gpfup_uploader_ready' , function ( gpfup ) {
14+ var store = window . GPFUP_24_1 . $store ;
15+
16+ if ( ! store ) {
17+ return ;
18+ }
19+
20+ store . subscribe ( function ( mutation , state ) {
21+ switch ( mutation . type ) {
22+ case 'OPEN_EDITOR' :
23+ pp_modal_fl6amr4d57jn . settings . click_exit = false ;
24+ break ;
25+
26+ case 'REPLACE_FILE' :
27+ pp_modal_fl6amr4d57jn . settings . click_exit = true ;
28+ break ;
29+ }
30+ } ) ;
31+ } ) ;
You can’t perform that action at this time.
0 commit comments