Merge pull request #3177 from Snuffleupagus/bug864619

Make spacebar work on document load - fixes bug 864619
This commit is contained in:
Yury Delendik 2013-04-30 08:30:58 -07:00
commit 8e5575421a
2 changed files with 9 additions and 8 deletions

View File

@ -76,7 +76,7 @@ limitations under the License.
<script type="text/javascript" src="viewer.js"></script>
</head>
<body>
<body tabindex="1">
<div id="outerContainer" class="loadingInProgress">
<div id="sidebarContainer">
@ -212,7 +212,7 @@ limitations under the License.
data-l10n-id="page_rotate_cw" ></menuitem>
</menu>
<div id="viewerContainer" tabindex="1">
<div id="viewerContainer">
<div id="viewer" contextmenu="viewerContextMenu"></div>
</div>

View File

@ -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) {