From adf61ea5b0fcd04c7c310cd7000dc508c3a0efdb Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 30 Apr 2013 16:44:51 +0200 Subject: [PATCH] Make spacebar work on document load - fixes bug 864619 --- web/viewer.html | 4 ++-- web/viewer.js | 13 +++++++------ 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/web/viewer.html b/web/viewer.html index 76b158d81..7ec84f050 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -76,7 +76,7 @@ limitations under the License. - +
@@ -212,7 +212,7 @@ limitations under the License. data-l10n-id="page_rotate_cw" > -
+
diff --git a/web/viewer.js b/web/viewer.js index 225e95ac9..111e0c990 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -1442,6 +1442,13 @@ var PDFView = { left + ',' + top; } self.setInitialView(storedHash, scale); + + // Make all navigation keys work on document load, + // unless the viewer is embedded in another page. + if (window.parent === window) { + PDFView.container.focus(); + PDFView.container.blur(); + } }); pagesPromise.then(function() { @@ -1480,12 +1487,6 @@ var PDFView = { self.outline = new DocumentOutlineView(outline); document.getElementById('viewOutline').disabled = !outline; }); - - // Make all navigation keys work on document load, - // unless the viewer is embedded in another page. - if (window.parent.location === window.location) { - PDFView.container.focus(); - } }); pdfDocument.getMetadata().then(function(data) {