Skip to content

Commit b82626f

Browse files
authored
gpfup-bb-cropper-modal-compat.js: Migrated.
1 parent e21b59b commit b82626f

File tree

1 file changed

+3
-27
lines changed

1 file changed

+3
-27
lines changed
Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,5 @@
11
/**
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-
* Instructions:
6-
* 1. Install our free Custom JavaScript for Gravity Forms plugin.
7-
* Download the plugin here: https://gravitywiz.com/gravity-forms-code-chest/
8-
* 2. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin.
9-
* 3. Update the form ID/field ID (e.g. GPFUP_24_1) and Beaver Builder modal ID (e.g. pp_modal_fl6amr4d57jn) accordingly.
2+
* We're no longer using the experimental folder for experimental snippets. 🚧
3+
* You can now find the snippet here:
4+
* https://github.com/gravitywiz/snippet-library/blob/master/gp-file-upload-pro/gpfup-bb-cropper-modal-compat.js
105
*/
11-
gform.addAction( 'gpfup_uploader_ready', function ( gpfup ) {
12-
var store = window.GPFUP_24_1.$store;
13-
14-
if ( !store ) {
15-
return;
16-
}
17-
18-
store.subscribe( function ( mutation, state ) {
19-
switch ( mutation.type ) {
20-
case 'OPEN_EDITOR':
21-
pp_modal_fl6amr4d57jn.settings.click_exit = false;
22-
break;
23-
24-
case 'REPLACE_FILE':
25-
pp_modal_fl6amr4d57jn.settings.click_exit = true;
26-
break;
27-
}
28-
} );
29-
} );

0 commit comments

Comments
 (0)