define(["require", "exports"], function (require, exports) {
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var Navigation = (function () {
function Navigation(viewer, viewerBase) {
this.pdfViewer = viewer;
this.pdfViewerBase = viewerBase;
}
Navigation.prototype.goToNextPage = function () {
this.pageNumber = this.pdfViewerBase.currentPageNumber;
this.pageNumber++;
if (this.pageNumber <= this.pdfViewerBase.pageCount) {
this.pdfViewerBase.updateScrollTop(this.pageNumber - 1);
}
};
Navigation.prototype.goToPreviousPage = function () {
this.pageNumber = this.pdfViewerBase.currentPageNumber;
this.pageNumber--;
if (this.pageNumber > 0) {
this.pdfViewerBase.updateScrollTop(this.pageNumber - 1);
}
};
Navigation.prototype.goToPage = function (pageNumber) {
if (pageNumber > 0 && pageNumber <= this.pdfViewerBase.pageCount && this.pdfViewerBase.currentPageNumber !== pageNumber) {
this.pdfViewerBase.updateScrollTop(pageNumber - 1);
if (this.pdfViewer.enableThumbnail) {
this.pdfViewer.thumbnailViewModule.updateScrollTopForThumbnail(pageNumber - 1);
}
}
if (this.pdfViewer.magnificationModule) {
this.pdfViewer.magnificationModule.resizeCanvas(pageNumber);
}
var textLayer = document.getElementById(this.pdfViewer.element.id + '_textLayer_' + (pageNumber - 1));
if (textLayer) {
textLayer.style.display = 'block';
}
};
Navigation.prototype.goToFirstPage = function () {
this.pageNumber = 0;
this.pdfViewerBase.updateScrollTop(this.pageNumber);
};
Navigation.prototype.goToLastPage = function () {
this.pageNumber = this.pdfViewerBase.pageCount - 1;
this.pdfViewerBase.updateScrollTop(this.pageNumber);
};
Navigation.prototype.destroy = function () {
this.pageNumber = 0;
};
Navigation.prototype.getModuleName = function () {
return 'Navigation';
};
return Navigation;
}());
exports.Navigation = Navigation;
});
|