Permalink
Browse files

Merge remote branch 'dc/master'

  • Loading branch information...
2 parents e2f5bec + 050c60d commit 85fe61f38abeb5940c17983ab8cf0531f7264bc9 @ashaw ashaw committed Oct 12, 2011
Showing with 23 additions and 2 deletions.
  1. +22 −1 public/javascripts/DV/helpers/helpers.js
  2. +1 −1 public/javascripts/DV/models/page.js
@@ -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.
@@ -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;
}

0 comments on commit 85fe61f

Please sign in to comment.