diff --git a/static/js/directives/pdfcanvas.js b/static/js/directives/pdfcanvas.js index 7028f7ad..48a503ce 100644 --- a/static/js/directives/pdfcanvas.js +++ b/static/js/directives/pdfcanvas.js @@ -93,6 +93,10 @@ define(['require', 'underscore', 'jquery', 'pdf'], function(require, _, $, pdf) }; PDFCanvas.prototype._showPage = function(page) { + if (page === this.scope.currentPageNumber) { + return; + } + console.log("Showing page", page, "/", this.scope.maxPageNumber); if (this.currentPage) { this.currentPage.destroy(); diff --git a/static/js/directives/presentation.js b/static/js/directives/presentation.js index 845f814a..1c04f7de 100644 --- a/static/js/directives/presentation.js +++ b/static/js/directives/presentation.js @@ -29,7 +29,7 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, $scope.layout.presentation = false; $scope.isPresenter = false; - $scope.hideControlsBar = false; + $scope.hideControlsBar = true; $scope.pendingPageRequest = null; $scope.presentationLoaded = false; @@ -180,17 +180,12 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, }; $scope.$on("pdfPageLoading", function(event, page) { - if (!$scope.isPresenter) { - return; - } - - _.each(peers, function(ignore, peerId) { - var peercall = mediaStream.webrtc.findTargetCall(peerId); + mediaStream.webrtc.callForEachCall(function(peercall) { mediaStream.api.apply("sendPresentation", { send: function(type, data) { return peercall.peerconnection.send(data); } - })(peerId, currentToken, { + })(peercall.id, currentToken, { Type: "Page", Page: page }); @@ -261,6 +256,7 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, }); uploadPresentation(info); $scope.isPresenter = true; + $scope.hideControlsBar = false; $scope.$emit("openPdf", f); }, this)); }, this)); @@ -278,6 +274,7 @@ define(['jquery', 'underscore', 'text!partials/presentation.html'], function($, finishDownloadPresentation(); $scope.layout.presentation = false; $scope.isPresenter = false; + $scope.hideControlsBar = true; $scope.$emit("mainview", "presentation", false); }; diff --git a/static/partials/presentation.html b/static/partials/presentation.html index bcf3d649..68d922e5 100644 --- a/static/partials/presentation.html +++ b/static/partials/presentation.html @@ -1,12 +1,12 @@