From 5478ea7bcfad304a03140ede19ee882b6b8bcdb1 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Thu, 21 Feb 2019 19:20:55 +0100 Subject: [PATCH] Import patch from lfuelling about overlay, dunno wat this do --- README.md | 4 ---- portal/assets/js/global.js | 17 +++++++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 4b2b3db..f5ef42c 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,3 @@ Array of regular expressions to be matched against URLS **and** URIs and their r #### default_language Language code used by default in views (**default**: `en`) - -#### theme - -Can be either `default` or `vapor`. \ No newline at end of file diff --git a/portal/assets/js/global.js b/portal/assets/js/global.js index 9507b9f..5ba7660 100644 --- a/portal/assets/js/global.js +++ b/portal/assets/js/global.js @@ -68,4 +68,21 @@ document.addEventListener('DOMContentLoaded', function() { addMaildrop.parentNode.insertBefore(inputDropClone, addMaildrop); }); + // FIXME - I don't understand what this do ... + // This looks kinda hackish :| + if(window.location != window.parent.location) { + // Set class to body to show we're in overlay + document.body.classList.add('overlay'); + let userContainer = document.querySelector('a.user-container'); + userContainer.classList.replace('user-container-info', 'user-container-edit'); + userContainer.setAttribute('href', userContainer + .getAttribute('href') + .replace('edit.html', '')); + userContainer.addEventListener('click', function(e) { + e.preventDefault(); + e.stopPropagation(); + window.parent.location.href = userContainer.getAttribute('href'); + }) + } + });