empreinte-digitale / orejime

An easy to use consent manager that focuses on accessibility.
https://orejime.empreintedigitale.fr/
Other
155 stars 26 forks source link

How to trigger / add callback after orejime save preference #103

Closed MatthieuScarset closed 6 months ago

MatthieuScarset commented 6 months ago

I don't find any way to react to the submit action which closes the modal.

For instance I'd like to refresh the page after user clicks on .orejime-Button--save

Thanks

MatthieuScarset commented 6 months ago

Okay... found it. It is documented on the readme:

            // Optional. A callback function that will be called each time
            // the consent state for the app changes. Passes
            // the `app` config as the second parameter as well.
            callback: function(consent, app){
                // This is an example callback function.
                console.log("User consent for app " + app.name + ": consent=" + consent)
            },

I had a hard time to find this options.

I think it might be a good idea to emphasize it better in the doc.

Thank you anyway.

felixgirault commented 6 months ago

Glad you found it! It may be hard to find indeed, and the option name isn't self-explanatory… This will change a bit in the upcoming version 3, we'll make sure to document it properly.