From 2b810970123bca052d7af8d3066ba88d9ca5acaf Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 24 Aug 2021 16:16:04 +0300 Subject: [PATCH] Fix creating new file when templates avaliable. --- apps/documenteditor/main/app/controller/LeftMenu.js | 2 +- apps/presentationeditor/main/app/controller/LeftMenu.js | 2 +- apps/spreadsheeteditor/main/app/controller/LeftMenu.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 683a81bbf7..a0327f889d 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -511,7 +511,7 @@ define([ onCreateNew: function(menu, type) { if ( !Common.Controllers.Desktop.process('create:new') ) { - if (this.mode.canRequestCreateNew) + if (type == 'blank' && this.mode.canRequestCreateNew) Common.Gateway.requestCreateNew(); else { var newDocumentPage = window.open(type == 'blank' ? this.mode.createUrl : type, "_blank"); diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index ed7d2ebc12..d1cbcebd3a 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -384,7 +384,7 @@ define([ onCreateNew: function(menu, type) { if ( !Common.Controllers.Desktop.process('create:new') ) { - if (this.mode.canRequestCreateNew) + if (type == 'blank' && this.mode.canRequestCreateNew) Common.Gateway.requestCreateNew(); else { var newDocumentPage = window.open(type == 'blank' ? this.mode.createUrl : type, "_blank"); diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index 6da017281a..efa63021c1 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -500,7 +500,7 @@ define([ onCreateNew: function(menu, type) { if ( !Common.Controllers.Desktop.process('create:new') ) { - if (this.mode.canRequestCreateNew) + if (type == 'blank' && this.mode.canRequestCreateNew) Common.Gateway.requestCreateNew(); else { var newDocumentPage = window.open(type == 'blank' ? this.mode.createUrl : type, "_blank");