diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 0105baa1f..59c735f7b 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -373,7 +373,7 @@ define([ this.appOptions.user.anonymous && Common.localStorage.setItem("guest-id", this.appOptions.user.id); this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop'; - this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl); + this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl) || this.editorConfig.templates && this.editorConfig.templates.length; this.appOptions.canOpenRecent = this.editorConfig.recent !== undefined && !this.appOptions.isDesktopApp; this.appOptions.templates = this.editorConfig.templates; this.appOptions.recent = this.editorConfig.recent; diff --git a/apps/documenteditor/main/app/view/FileMenu.js b/apps/documenteditor/main/app/view/FileMenu.js index 5d93afa5a..9345c5626 100644 --- a/apps/documenteditor/main/app/view/FileMenu.js +++ b/apps/documenteditor/main/app/view/FileMenu.js @@ -389,7 +389,7 @@ define([ if ( this.mode.canCreateNew ) { if (this.mode.templates && this.mode.templates.length) { $('a',this.miNew.$el).text(this.btnCreateNewCaption + '...'); - !this.panels['new'] && (this.panels['new'] = ((new DE.Views.FileMenuPanels.CreateNew({menu: this, docs: this.mode.templates})).render())); + !this.panels['new'] && (this.panels['new'] = ((new DE.Views.FileMenuPanels.CreateNew({menu: this, docs: this.mode.templates, blank: this.mode.canRequestCreateNew || !!this.mode.createUrl})).render())); } } diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index fdcd5f5bb..6bdc32cad 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -869,21 +869,23 @@ define([ template: _.template([ '

<%= scope.txtCreateNew %>

', '
', + '<% if (blank) { %> ', '
', '
', '', '
', '
<%= scope.txtBlank %>
', '
', - '<% _.each(docs, function(item, index) { %>', - '
', - '
', - ' style="background-image: url(<%= item.image %>);">', - ' <%} else {' + - 'print(\">\")' + - ' } %>', - '
', + '<% } %>', + '<% _.each(docs, function(item, index) { %>', + '
', + '
', + ' style="background-image: url(<%= item.image %>);">', + ' <%} else {' + + 'print(\">\")' + + ' } %>', + '
', '
<%= Common.Utils.String.htmlEncode(item.title || item.name || "") %>
', '
', '<% }) %>', @@ -894,14 +896,17 @@ define([ Common.UI.BaseView.prototype.initialize.call(this,arguments); this.menu = options.menu; + this.docs = options.docs; + this.blank = !!options.blank; }, render: function() { this.$el.html(this.template({ scope: this, - docs: this.options[0].docs + docs: this.docs, + blank: this.blank })); - var docs=[{title: this.txtBlank}].concat(this.options[0].docs); + var docs = (this.blank ? [{title: this.txtBlank}] : []).concat(this.docs); var thumbsElm= this.$el.find('.thumb-wrap, .blank-document'); _.each(thumbsElm, function (tmb, index){ $(tmb).find('.title').tooltip({ diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 3262bedd7..98e93c771 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -333,7 +333,7 @@ define([ this.appOptions.user.anonymous && Common.localStorage.setItem("guest-id", this.appOptions.user.id); this.appOptions.isDesktopApp = this.editorConfig.targetApp == 'desktop'; - this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl); + this.appOptions.canCreateNew = this.editorConfig.canRequestCreateNew || !_.isEmpty(this.editorConfig.createUrl) || this.editorConfig.templates && this.editorConfig.templates.length; this.appOptions.canOpenRecent = this.editorConfig.recent !== undefined && !this.appOptions.isDesktopApp; this.appOptions.templates = this.editorConfig.templates; this.appOptions.recent = this.editorConfig.recent; diff --git a/apps/presentationeditor/main/app/view/FileMenu.js b/apps/presentationeditor/main/app/view/FileMenu.js index c7de276c4..696fd31d0 100644 --- a/apps/presentationeditor/main/app/view/FileMenu.js +++ b/apps/presentationeditor/main/app/view/FileMenu.js @@ -388,7 +388,7 @@ define([ if ( this.mode.canCreateNew ) { if (this.mode.templates && this.mode.templates.length) { $('a',this.miNew.$el).text(this.btnCreateNewCaption + '...'); - !this.panels['new'] && (this.panels['new'] = (new PE.Views.FileMenuPanels.CreateNew({menu: this, docs: this.mode.templates})).render()); + !this.panels['new'] && (this.panels['new'] = (new PE.Views.FileMenuPanels.CreateNew({menu: this, docs: this.mode.templates, blank: this.mode.canRequestCreateNew || !!this.mode.createUrl})).render()); } } diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index aa15bb4a4..c8fdf8c92 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -767,12 +767,14 @@ define([ template: _.template([ '

<%= scope.txtCreateNew %>

', '
', + '<% if (blank) { %> ', '
', '
', '', '
', '
<%= scope.txtBlank %>
', '
', + '<% } %>', '<% _.each(docs, function(item, index) { %>', '
', '
<%= scope.txtCreateNew %>', '
', + '<% if (blank) { %> ', '
', '
', '', '
', '
<%= scope.txtBlank %>
', '
', + '<% } %>', '<% _.each(docs, function(item, index) { %>', '
', '