docs: Improve theme passthrough code comments

This commit is contained in:
Rene Hampölz 2023-05-31 10:35:24 +00:00
parent 3d3e6d0961
commit a65415a276

View file

@ -1,7 +1,7 @@
/** /**
* Nextcloud - SnappyMail mail plugin * Nextcloud - SnappyMail mail plugin
* *
* @author RainLoop Team, Nextgen-Networks (@nextgen-networks), Tab Fitts (@tabp0le), Pierre-Alain Bandinelli (@pierre-alain-b), SnappyMail * @author RainLoop Team, Nextgen-Networks (@nextgen-networks), Tab Fitts (@tabp0le), Pierre-Alain Bandinelli (@pierre-alain-b), SnappyMail, Rene Hampölz (@hampoelz)
* *
* Based initially on https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud/rainloop-app * Based initially on https://github.com/RainLoop/rainloop-webmail/tree/master/build/owncloud/rainloop-app
*/ */
@ -15,6 +15,8 @@ document.onreadystatechange = () => {
} }
}; };
// Pass Nextcloud themes and theme attributes to SnappyMail on
// first load and when the SnappyMail iframe is reloaded.
document.addEventListener('DOMContentLoaded', () => { document.addEventListener('DOMContentLoaded', () => {
const iframe = document.getElementById('rliframe'); const iframe = document.getElementById('rliframe');
if (!iframe) return; if (!iframe) return;
@ -30,11 +32,9 @@ document.addEventListener('DOMContentLoaded', () => {
}); });
passThemes(iframe); passThemes(iframe);
// TODO: add initial stylesheets without primary colors to improve loading experience
}); });
// Pass nextcloud themes and theme attributes to SnappyMail. // Pass Nextcloud themes and theme attributes to SnappyMail.
function passThemes(iframe) { function passThemes(iframe) {
if (!iframe) return; if (!iframe) return;