Fix opening pdf and pdf-form files

This commit is contained in:
Julia Radzhabova
2023-12-01 21:25:12 +03:00
parent 35eb9d54ec
commit 35714543af
2 changed files with 7 additions and 4 deletions

View File

@ -951,8 +951,11 @@ DE.ApplicationController = new(function(){
});
window["flat_desine"] = true;
var result = /[\?\&]fileType=\b(pdf|djvu|xps|oxps)\b&?/i.exec(window.location.search),
isPDF = (!!result && result.length && typeof result[1] === 'string');
var result = /[\?\&]fileType=\b(pdf)|(djvu|xps|oxps)\b&?/i.exec(window.location.search),
docType = /[\?\&]documentType=\b(word)\b&?/i.exec(window.location.search),
isPDF = (!!result && result.length && typeof result[2] === 'string') || (!!result && result.length && typeof result[1] === 'string') &&
(!docType || !docType.length || typeof docType[1] !== 'string');
api = isPDF ? new Asc.PDFEditorApi({
'id-view' : 'editor_sdk',

View File

@ -345,8 +345,8 @@ class MainController extends Component {
var result = /[\?\&]fileType=\b(pdf)|(djvu|xps|oxps)\b&?/i.exec(window.location.search),
docType = /[\?\&]documentType=\b(word)\b&?/i.exec(window.location.search),
isPDF = (!!result && result.length && typeof result[2] === 'string') || !!result && result.length && typeof result[1] === 'string' &&
!!docType && docType.length && typeof docType[1] !== 'string';
isPDF = (!!result && result.length && typeof result[2] === 'string') || (!!result && result.length && typeof result[1] === 'string') &&
(!docType || !docType.length || typeof docType[1] !== 'string');
this.api = isPDF ? new Asc.PDFEditorApi({
'id-view' : 'editor_sdk',