mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 15:18:08 +02:00
Make the 'download' button behavior more robust
This commit is contained in:
parent
6d2c5414bf
commit
f3dc4206ee
2 changed files with 8 additions and 12 deletions
|
@ -85,10 +85,6 @@ var PDFView = {
|
|||
this.setScale(newScale, true);
|
||||
},
|
||||
|
||||
download: function pdfViewDownload() {
|
||||
window.open(document.title, '_parent', 'pdf=yes');
|
||||
},
|
||||
|
||||
set page(val) {
|
||||
var pages = this.pages;
|
||||
var input = document.getElementById('pageNumber');
|
||||
|
@ -119,7 +115,7 @@ var PDFView = {
|
|||
},
|
||||
|
||||
open: function pdfViewOpen(url, scale) {
|
||||
document.title = url;
|
||||
document.title = this.url = url;
|
||||
|
||||
getPdf(
|
||||
{
|
||||
|
@ -135,6 +131,10 @@ var PDFView = {
|
|||
});
|
||||
},
|
||||
|
||||
download: function pdfViewDownload() {
|
||||
window.open(this.url + '?pdfjs.action=download', '_parent');
|
||||
},
|
||||
|
||||
navigateTo: function pdfViewNavigateTo(dest) {
|
||||
if (typeof dest === 'string')
|
||||
dest = this.destinations[dest];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue