Summary Files Commits Branches @commit @diff @stats
path: root / src / scripts
diff options
context:
space:
mode:
Commitc6cd443da038de421909278726b18972dd4cc19a (patch)
Author
 Syndamia <kamen@syndamia.com>
2023-07-11 12:49:45 +0300
Committer
 Syndamia <kamen@syndamia.com>
2023-07-11 12:49:45 +0300
Filesf38425bfe676ff5feb3a507f9d0b12c8edc1f55a /src/scripts
syndamia.com-c6cd443da038de421909278726b18972dd4cc19a.tar
syndamia.com-c6cd443da038de421909278726b18972dd4cc19a.tar.gz
syndamia.com-c6cd443da038de421909278726b18972dd4cc19a.zip
Parent0635b41dd22b5978475b95fffba94fe2a19d82fc (diff)
(presentation) Disabled present mode being activated while in article mode and minor code formatting fixes
1 files changed, 4 insertions, 2 deletions
-rw-r--r--src/scripts/presentation.js6
diff --git a/src/scripts/presentation.js b/src/scripts/presentation.js
index 98849a2..8dd4960 100644
--- a/src/scripts/presentation.js
+++ b/src/scripts/presentation.js
@@ -58,11 +58,14 @@ var pageY = 0;
var pageX = 0;
function togglePresentMode() {
+ if (document.styleSheets.item(3).disabled) return;
+
// Hide the whole page
document.body.classList.toggle('invisible');
document.body.classList.toggle('no-overflow');
// Fix background color
document.body.classList.toggle('body-bg-color');
+
// Show the slide controller
presentCont.classList.toggle('absolute-cont');
for (var i = presentCont.children.length - 1; i >= 0; i--) {
@@ -76,6 +79,7 @@ function togglePresentMode() {
presentBtn.innerHTML = 'Present ' + presentBtn.innerHTML;
// Show the first slide
slides[slideIndex].classList.toggle('absolute-slide');
+
// Alignment of presentation to screen
if (presenting) {
window.scrollTo(pageX, pageY);
@@ -84,10 +88,8 @@ function togglePresentMode() {
pageY = window.scrollY; pageX = window.scrollX;
window.scrollTo(0, 0);
}
-
presenting = !presenting;
fixAbsoluteSlideScale();
-});
}
presentBtn.addEventListener('click', togglePresentMode);