Import patch from lfuelling about overlay, dunno wat this do

This commit is contained in:
Alexandre Aubin 2019-02-21 19:20:55 +01:00
parent 40e78b6b0a
commit 5478ea7bcf
2 changed files with 17 additions and 4 deletions

View file

@ -173,7 +173,3 @@ Array of regular expressions to be matched against URLS **and** URIs and their r
#### default_language #### default_language
Language code used by default in views (**default**: `en`) Language code used by default in views (**default**: `en`)
#### theme
Can be either `default` or `vapor`.

View file

@ -68,4 +68,21 @@ document.addEventListener('DOMContentLoaded', function() {
addMaildrop.parentNode.insertBefore(inputDropClone, addMaildrop); 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');
})
}
}); });