Browse Source

Don't show first page initially if not presenter.

pull/70/head
Joachim Bauch 11 years ago committed by Joachim Bauch
parent
commit
f8a9c78d14
  1. 21
      static/js/directives/pdfviewer.js

21
static/js/directives/pdfviewer.js

@ -127,10 +127,7 @@ define(['require', 'jquery', 'underscore', 'text!partials/pdfviewer.html', 'pdf' @@ -127,10 +127,7 @@ define(['require', 'jquery', 'underscore', 'text!partials/pdfviewer.html', 'pdf'
// ...and flip the buffers...
scope.canvasIndex = 1 - scope.canvasIndex;
console.log("Done");
if (scope.pendingPageNumber !== null) {
scope.showPage(scope.pendingPageNumber);
scope.pendingPageNumber = null;
}
scope.showQueuedPage();
});
});
});
@ -156,13 +153,25 @@ define(['require', 'jquery', 'underscore', 'text!partials/pdfviewer.html', 'pdf' @@ -156,13 +153,25 @@ define(['require', 'jquery', 'underscore', 'text!partials/pdfviewer.html', 'pdf'
}
};
$scope.showQueuedPage = function() {
if ($scope.pendingPageNumber !== null) {
$scope.showPage($scope.pendingPageNumber);
$scope.pendingPageNumber = null;
}
};
$scope.doOpenFile = function(source) {
pdf.getDocument(source).then(function(doc) {
$scope.$apply(function(scope) {
scope.doc = doc;
scope.maxPageNumber = doc.numPages;
scope.currentPageNumber = -1;
console.log("PDF loaded", doc);
scope.$emit("queuePageRendering", 1);
if ($scope.isPresenter) {
scope.$emit("queuePageRendering", 1);
} else {
scope.showQueuedPage();
}
});
});
};
@ -301,8 +310,8 @@ define(['require', 'jquery', 'underscore', 'text!partials/pdfviewer.html', 'pdf' @@ -301,8 +310,8 @@ define(['require', 'jquery', 'underscore', 'text!partials/pdfviewer.html', 'pdf'
//console.log("PdfViewer token request", currenttoken, data, type);
session.handleRequest(subscope, xfer, data);
}, "xfer");
$scope.openFile(f);
$scope.isPresenter = true;
$scope.openFile(f);
}, this));
}, this));
binder.namespace = function() {

Loading…
Cancel
Save