Hello,

I would like to have a link to re-open / reset the visitor preferences.
I tried this but it's not working:
$(document).ready(function(){ $( '.gdprprefs' ).on( 'click', function() { $( this ).orejime.show(); }); });
Any help ?

Comments

jbfelix created an issue. See original summary.

jbfelix’s picture

Done:

<span class="gdprprefs"><i class="fa fa-eye-slash" aria-hidden="true"></i></span>

Then:

<script>
 document.querySelector('.gdprprefs').addEventListener('click', function() {
                orejime.show();
            }, false);
</script>

Working example:

https://www.lodewijkdevadder.net

jbfelix’s picture

jbfelix’s picture

fabsgugu’s picture

Hello,

I see two solutions to make the banner reappear: The first delete the cookie (need refresh) and the second this code:
Orejime.init(window.orejimeConfig).show()

Otherwise, if a new service is added, the banner will reappear to prevent a change from taking place.

jbfelix’s picture

FYI
For consent reset:

document.querySelector('.elementclass').addEventListener('click', function() {
                orejime.internals.manager.resetConsent();
                location.reload(false);
            }, false);

Tip: location.reload(false); means page refresh from cache

fabsgugu’s picture

Assigned: Unassigned » fabsgugu

  • Fabsgugu committed 5da4db2 on 8.x-1.x
    Issue #3119217: How to update preferences
    
fabsgugu’s picture

I added in the JS the script allowing to reset and the one to bring up the modal.

Reset : button with class "reset-button"
Modal : button with class "consent-modal-button"

fabsgugu’s picture

Status: Active » Needs review
fabsgugu’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.