From 37f5d561267b055f7f3a3496c0fe3073c3f4a9f9 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 29 Oct 2021 20:15:38 +0300 Subject: [PATCH] [DE forms] Show download button --- apps/common/forms/resources/less/common.less | 1 + .../forms/app/controller/ApplicationController.js | 4 ++++ apps/documenteditor/forms/app/view/ApplicationView.js | 7 +++++++ apps/documenteditor/forms/index.html | 1 + apps/documenteditor/forms/index.html.deploy | 1 + 5 files changed, 14 insertions(+) diff --git a/apps/common/forms/resources/less/common.less b/apps/common/forms/resources/less/common.less index a8d56caac..58b92d28a 100644 --- a/apps/common/forms/resources/less/common.less +++ b/apps/common/forms/resources/less/common.less @@ -228,6 +228,7 @@ } .btn-text-default { + width: auto; &.colored { padding: 0 16px; height: 28px; diff --git a/apps/documenteditor/forms/app/controller/ApplicationController.js b/apps/documenteditor/forms/app/controller/ApplicationController.js index 4d739d38e..8d095d3c7 100644 --- a/apps/documenteditor/forms/app/controller/ApplicationController.js +++ b/apps/documenteditor/forms/app/controller/ApplicationController.js @@ -459,6 +459,7 @@ define([ var me = this; me.view.btnSubmit.setVisible(this.appOptions.canFillForms && this.appOptions.canSubmitForms); + me.view.btnDownload.setVisible(this.appOptions.canDownload && this.appOptions.canFillForms && !this.appOptions.canSubmitForms); if (!this.appOptions.canFillForms) { me.view.btnPrev.setVisible(false); me.view.btnNext.setVisible(false); @@ -476,6 +477,9 @@ define([ me.view.btnSubmit.on('click', function(){ me.api.asc_SendForm(); }); + me.view.btnDownload.on('click', function(){ + me.appOptions.canDownload && me.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.PDF)); + }); this.api.asc_setRestriction(Asc.c_oAscRestrictionType.OnlyForms); this.api.asc_SetFastCollaborative(true); diff --git a/apps/documenteditor/forms/app/view/ApplicationView.js b/apps/documenteditor/forms/app/view/ApplicationView.js index b25dfde59..0c1db683e 100644 --- a/apps/documenteditor/forms/app/view/ApplicationView.js +++ b/apps/documenteditor/forms/app/view/ApplicationView.js @@ -68,6 +68,13 @@ define([ }); this.btnSubmit.render($('#id-submit-group')); + this.btnDownload = new Common.UI.Button({ + cls: 'btn-text-default colored margin-left-small margin-right-small', + caption: this.txtDownload, + hint: this.txtDownloadPdf + }); + this.btnDownload.render($('#id-download-group')); + this.txtGoToPage = new Common.UI.InputField({ el: $('#page-number'), cls: 'masked', diff --git a/apps/documenteditor/forms/index.html b/apps/documenteditor/forms/index.html index af57622d0..43e5c43a8 100644 --- a/apps/documenteditor/forms/index.html +++ b/apps/documenteditor/forms/index.html @@ -237,6 +237,7 @@
of 1
+
diff --git a/apps/documenteditor/forms/index.html.deploy b/apps/documenteditor/forms/index.html.deploy index 1c6eb17af..05a8ed0d0 100644 --- a/apps/documenteditor/forms/index.html.deploy +++ b/apps/documenteditor/forms/index.html.deploy @@ -210,6 +210,7 @@
of 1
+