]> git.parisson.com Git - pdf.js.git/commitdiff
Assign the filename to the page title instead of the full URL
authorgigaherz <gigaherz@gmail.com>
Fri, 23 Mar 2012 15:26:06 +0000 (16:26 +0100)
committergigaherz <gigaherz@gmail.com>
Fri, 23 Mar 2012 15:26:22 +0000 (16:26 +0100)
web/viewer.js

index 67ef67e97ef9cf99c14033df8699f071cf72e126..73a65ca05ea9c3ec2fce400b914590dc2b8918b2 100644 (file)
@@ -258,7 +258,9 @@ var PDFView = {
   },
 
   open: function pdfViewOpen(url, scale) {
-    document.title = this.url = url;
+    this.url = url;
+
+    document.title = (url.substring(url.lastIndexOf('/')+1)) || url;
 
     var self = this;
     PDFJS.getPdf(