diff --git a/apps/documenteditor/embed/js/ApplicationController.js b/apps/documenteditor/embed/js/ApplicationController.js index a09f7b5f85..68680b98ff 100644 --- a/apps/documenteditor/embed/js/ApplicationController.js +++ b/apps/documenteditor/embed/js/ApplicationController.js @@ -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', diff --git a/apps/documenteditor/mobile/src/controller/Main.jsx b/apps/documenteditor/mobile/src/controller/Main.jsx index 37d224a94f..090be416e0 100644 --- a/apps/documenteditor/mobile/src/controller/Main.jsx +++ b/apps/documenteditor/mobile/src/controller/Main.jsx @@ -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',