Skip to content

Commit

Permalink
Merge remote branch 'dc/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ashaw committed Oct 12, 2011
2 parents e2f5bec + 050c60d commit 85fe61f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
23 changes: 22 additions & 1 deletion public/javascripts/DV/helpers/helpers.js
Expand Up @@ -298,7 +298,28 @@ DV.Schema.helpers = {

openFullScreen : function() {
var doc = this.viewer.schema.document;
window.open(doc.canonicalURL, "documentviewer", "toolbar=no,resizable=yes,scrollbars=no,status=no");
var url = doc.canonicalURL.replace(/#\S+$/,"");
var currentPage = this.models.document.currentPage();

// construct url fragment based on current viewer state
switch (this.viewer.state) {
case 'ViewAnnotation':
url += '#annotation/a' + this.viewer.activeAnnotationId; // default to the top of the annotations page.
break;
case 'ViewDocument':
url += '#document/p' + currentPage;
break;
case 'ViewSearch':
url += '#search/p' + currentPage + '/' + encodeURIComponent(this.elements.searchInput.val());
break;
case 'ViewText':
url += '#text/p' + currentPage;
break;
case 'ViewThumbnails':
url += '#pages/p' + currentPage; // need to set up a route to catch this.
break;
}
window.open(url, "documentviewer", "toolbar=no,resizable=yes,scrollbars=no,status=no");
},

// Determine the correct DOM page ordering for a given page index.
Expand Down
2 changes: 1 addition & 1 deletion public/javascripts/DV/models/page.js
Expand Up @@ -90,7 +90,7 @@ DV.model.Pages.prototype = {
if (h === height) return;
this.viewer.models.document.computeOffsets();
this.viewer.pageSet.simpleReflowPages();
if (pageIndex < this.viewer.models.document.currentIndex()) {
if (!this.viewer.activeAnnotation && (pageIndex < this.viewer.models.document.currentIndex())) {
var diff = Math.round(height * this.zoomFactor() - h);
this.viewer.elements.window[0].scrollTop += diff;
}
Expand Down

0 comments on commit 85fe61f

Please sign in to comment.