diff --git a/components/privacy_settings/privacy_settings.js b/components/privacy_settings/privacy_settings.js index a3c90d6..36bcf8a 100644 --- a/components/privacy_settings/privacy_settings.js +++ b/components/privacy_settings/privacy_settings.js @@ -76,12 +76,9 @@ AmbientImpact.addComponent('OmnipediaPrivacySettings', function( 'click.OmnipediaPrivacySettings', Drupal.eu_cookie_compliance.toggleWithdrawBanner ) - .insertAfter($placeholderLink) - // Save the placeholder link to this button's data so that we can - // restore it on detach. - .data('privacySettingsLink', $placeholderLink); + .insertAfter($placeholderLink); - $placeholderLink.remove(); + $placeholderLink.attr('hidden', true); $toggle = $button; @@ -95,11 +92,19 @@ AmbientImpact.addComponent('OmnipediaPrivacySettings', function( */ var $button = $('.omnipedia-privacy-settings-toggle', context); - // Restore the previously stored placeholder link. - $button.data('privacySettingsLink').insertAfter($button); + /** + * The privacy settings placeholder link wrapped in a jQuery collection. + * + * @type {jQuery} + */ + var $placeholderLink = $( + '.omnipedia-privacy-settings-placeholder', context + ); $button.remove(); + $placeholderLink.removeAttr('hidden'); + $toggle = $(); } diff --git a/components/privacy_settings/privacy_settings.scss b/components/privacy_settings/privacy_settings.scss index f4c315d..ac2f685 100644 --- a/components/privacy_settings/privacy_settings.scss +++ b/components/privacy_settings/privacy_settings.scss @@ -7,7 +7,10 @@ // in such a way that should minimize or eliminate any layout shifting when the // swap occurs. .omnipedia-privacy-settings-placeholder { - display: inline-grid !important; + + &:not([hidden]) { + display: inline-grid !important; + } grid-template-areas: 'content';