Skip to content

Commit

Permalink
disable overview while in reader mode
Browse files Browse the repository at this point in the history
  • Loading branch information
hakimel committed Oct 11, 2023
1 parent be5d811 commit 980b902
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 21 deletions.
6 changes: 4 additions & 2 deletions css/reveal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2013,11 +2013,13 @@ $notesWidthPercent: 25%;
display: none;
}

.has-dark-background {
.reveal.has-dark-background,
.reveal-viewport.has-dark-background {
--r-overlay-element-bg-color: 240, 240, 240;
--r-overlay-element-fg-color: 0, 0, 0;
}
.has-light-background {
.reveal.has-light-background,
.reveal-viewport.has-light-background {
--r-overlay-element-bg-color: 0, 0, 0;
--r-overlay-element-fg-color: 240, 240, 240;
}
Expand Down
2 changes: 1 addition & 1 deletion dist/reveal.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.esm.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.esm.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/reveal.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/controllers/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default class Overview {
activate() {

// Only proceed if enabled in config
if( this.Reveal.getConfig().overview && !this.isActive() ) {
if( this.Reveal.getConfig().overview && !this.Reveal.isReaderMode() && !this.isActive() ) {

this.active = true;

Expand Down
26 changes: 13 additions & 13 deletions js/controllers/reader.js
Original file line number Diff line number Diff line change
Expand Up @@ -198,19 +198,6 @@ export default class Reader {

this.viewportElement.insertBefore( this.progressBar, this.viewportElement.firstChild );

const handleMouseDown = ( event ) => {

event.preventDefault();

this.draggingProgressBar = true;

document.addEventListener( 'mousemove', handleDocumentMouseMove );
document.addEventListener( 'mouseup', handleDocumentMouseUp );

handleDocumentMouseMove( event );

};

const handleDocumentMouseMove = ( event ) => {

let progress = ( event.clientY - this.progressBarInner.getBoundingClientRect().top ) / this.progressBarHeight;
Expand All @@ -231,6 +218,19 @@ export default class Reader {

};

const handleMouseDown = ( event ) => {

event.preventDefault();

this.draggingProgressBar = true;

document.addEventListener( 'mousemove', handleDocumentMouseMove );
document.addEventListener( 'mouseup', handleDocumentMouseUp );

handleDocumentMouseMove( event );

};

this.progressBarInner.addEventListener( 'mousedown', handleMouseDown );

}
Expand Down

0 comments on commit 980b902

Please sign in to comment.