From 88704fd2891fc23e16bc4054af8aff987d3d4215 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Thu, 15 May 2014 16:11:59 +0200 Subject: Fix popup mode when opening a presentation in a new tab --- js/slide-controller.js | 8 ++++---- js/slide-deck.js | 16 ++++++++-------- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'js') diff --git a/js/slide-controller.js b/js/slide-controller.js index bef37c4..2fb2560 100644 --- a/js/slide-controller.js +++ b/js/slide-controller.js @@ -12,14 +12,13 @@ this.mode = null; this.remoteSocket = null; - this.isPresenter = window.opener; - this.isController = window.opener; + this.isPresenter = false; + this.isController = false; this.keyLock = null; this.setup(); - } - + }; SlideController.MODES = ['local', 'remote', 'controller', 'presenter']; @@ -68,6 +67,7 @@ // Loading in the popup? Turn the presenter mode on. localPresenter.addEventListener('load', function(e) { + localPresenter.document.body.classList.add('popup'); localPresenter.document.body.classList.add('with-notes'); }.bind(this), false); diff --git a/js/slide-deck.js b/js/slide-deck.js index 2943658..b93cea8 100644 --- a/js/slide-deck.js +++ b/js/slide-deck.js @@ -111,9 +111,9 @@ SlideDeck.prototype.onDomLoaded_ = function(e) { // // Also, no need to set this up if we're on mobile. // if (!Modernizr.touch) { this.controller = new SlideController(this); - if (this.controller.isPresenter) { - document.body.classList.add('popup'); - } + // if (this.controller.isPresenter) { + // document.body.classList.add('popup'); + // } // } }; @@ -223,11 +223,11 @@ SlideDeck.prototype.onBodyKeyDown_ = function(e) { break; case 80: // P - if (this.controller && this.controller.isPresenter) { - document.body.classList.toggle('with-notes'); - } else if (this.controller && !this.controller.popup) { - document.body.classList.toggle('with-notes'); - } + // if (this.controller && this.controller.isPresenter) { + document.body.classList.toggle('with-notes'); + // } else if (this.controller && !this.controller.popup) { + // document.body.classList.toggle('with-notes'); + // } break; case 82: // R -- cgit v1.2.3