mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-18 16:36:15 +00:00
[pdf file view] bugfix
This commit is contained in:
@@ -92,7 +92,7 @@ window.onload = function () {
|
||||
{% endif %}
|
||||
|
||||
{% if filetype == 'PDF' and use_pdfjs %}
|
||||
if (!($.browser.msie && parseInt($.browser.version) < 10)) {
|
||||
try {
|
||||
PDFJS.workerSrc = '{{MEDIA_URL}}js/pdf.worker.js';
|
||||
$('#file-view').html('<div id="pdf"><span class="loading-icon loading-tip"></span></div>');
|
||||
PDFJS.getDocument("{{ raw_path|escapejs }}").then(function(pdf) {
|
||||
@@ -129,7 +129,7 @@ if (!($.browser.msie && parseInt($.browser.version) < 10)) {
|
||||
getPageAndRender(1);
|
||||
});
|
||||
|
||||
} else {
|
||||
} catch(e) {
|
||||
$('#file-view').html('<div id="file-view-tip"><p>{% trans "You can use IE 10 or other browsers, for example, Firefox, to view it online." %}</p></div>');
|
||||
}
|
||||
{% endif %}
|
||||
|
@@ -25,7 +25,7 @@
|
||||
{% else %}
|
||||
<script type="text/javascript" src="{{MEDIA_URL}}js/pdf.js"></script>
|
||||
<script type="text/javascript">
|
||||
if (!($.browser.msie && parseInt($.browser.version) < 10)) {
|
||||
try {
|
||||
PDFJS.workerSrc = '{{MEDIA_URL}}js/pdf.worker.js';
|
||||
$('#file-view').html('<div id="pdf"><span class="loading-icon loading-tip"></span></div>');
|
||||
PDFJS.getDocument("{{ raw_path|escapejs }}").then(function(pdf) {
|
||||
@@ -62,7 +62,7 @@ if (!($.browser.msie && parseInt($.browser.version) < 10)) {
|
||||
getPageAndRender(1);
|
||||
});
|
||||
|
||||
} else {
|
||||
} catch(e) {
|
||||
var tip = "{% trans "You can use IE 10 or other browsers, for example, Firefox, to view it online." %}";
|
||||
$('#file-view').html('<div id="file-view-tip"><p>' + tip + '</p></div>');
|
||||
}
|
||||
|
Reference in New Issue
Block a user