Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gpfup-bb-cropper-modal-compat.js: Migrated. #969

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 3 additions & 27 deletions experimental/gpfup-bb-cropper-modal-compat.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,5 @@
/**
* Gravity Perks // GP File Upload Pro // Prevent cropper from closing Beaver Builder modal that a form is embedded in
* https://gravitywiz.com/documentation/gravity-forms-file-upload-pro/
*
* Instructions:
* 1. Install our free Custom JavaScript for Gravity Forms plugin.
* Download the plugin here: https://gravitywiz.com/gravity-forms-code-chest/
* 2. Copy and paste the snippet into the editor of the Custom Javascript for Gravity Forms plugin.
* 3. Update the form ID/field ID (e.g. GPFUP_24_1) and Beaver Builder modal ID (e.g. pp_modal_fl6amr4d57jn) accordingly.
* We're no longer using the experimental folder for experimental snippets. 🚧
* You can now find the snippet here:
* https://github.com/gravitywiz/snippet-library/blob/master/gp-file-upload-pro/gpfup-bb-cropper-modal-compat.js
*/
gform.addAction( 'gpfup_uploader_ready', function ( gpfup ) {
var store = window.GPFUP_24_1.$store;

if ( !store ) {
return;
}

store.subscribe( function ( mutation, state ) {
switch ( mutation.type ) {
case 'OPEN_EDITOR':
pp_modal_fl6amr4d57jn.settings.click_exit = false;
break;

case 'REPLACE_FILE':
pp_modal_fl6amr4d57jn.settings.click_exit = true;
break;
}
} );
} );
Loading