From 5c1ff8633efc3818e26e0e97f0e8f749fd4212d3 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 9 Nov 2021 18:39:35 +0300 Subject: [PATCH 1/2] [DE] Show tip for save as form button --- .../main/app/controller/FormsTab.js | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/apps/documenteditor/main/app/controller/FormsTab.js b/apps/documenteditor/main/app/controller/FormsTab.js index 293cf4a0c6..87a70e1b2c 100644 --- a/apps/documenteditor/main/app/controller/FormsTab.js +++ b/apps/documenteditor/main/app/controller/FormsTab.js @@ -98,6 +98,9 @@ define([ 'forms:goto': this.onGoTo, 'forms:submit': this.onSubmitClick, 'forms:save': this.onSaveFormClick + }, + 'Toolbar': { + 'tab:active': this.onActiveTab } }); }, @@ -188,6 +191,11 @@ define([ oPr = new AscCommon.CSdtTextFormPr(); this.api.asc_AddContentControlTextForm(oPr, oFormPr); } + + var me = this; + setTimeout(function() { + me.showSaveFormTip(); + }, 500); Common.NotificationCenter.trigger('edit:complete', this.toolbar); }, @@ -385,6 +393,35 @@ define([ }); tip.show(); } + }, + + showSaveFormTip: function() { + if (!Common.localStorage.getItem("de-hide-saveform-tip") && !this.tipSaveForm) { + var me = this; + me.tipSaveForm = new Common.UI.SynchronizeTip({ + extCls: 'colored', + placement: 'bottom-right', + target: this.view.btnSaveForm.$el, + text: this.view.tipSaveForm, + showLink: false, + closable: false, + showButton: true, + textButton: this.view.textGotIt + }); + me.tipSaveForm.on({ + 'buttonclick': function() { + Common.localStorage.setItem("de-hide-saveform-tip", 1); + me.tipSaveForm.close(); + } + }); + me.tipSaveForm.show(); + } + }, + + onActiveTab: function(tab) { + if (tab !== 'forms') { + this.tipSaveForm && this.tipSaveForm.close(); + } } }, DE.Controllers.FormsTab || {})); From 86bdcc5c5cd8de25e00237d767e4ce5b0ccf17be Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 9 Nov 2021 18:43:03 +0300 Subject: [PATCH 2/2] [DE] Disable buttons on start --- apps/documenteditor/main/app/view/FormsTab.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/documenteditor/main/app/view/FormsTab.js b/apps/documenteditor/main/app/view/FormsTab.js index 9e83a0b4f6..4e45e2c234 100644 --- a/apps/documenteditor/main/app/view/FormsTab.js +++ b/apps/documenteditor/main/app/view/FormsTab.js @@ -269,6 +269,7 @@ define([ cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon previous-field', caption: this.capBtnPrev, + disabled: true, dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' @@ -279,6 +280,7 @@ define([ cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon next-field', caption: this.capBtnNext, + disabled: true, dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' @@ -290,6 +292,7 @@ define([ cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon submit-form', caption: this.capBtnSubmit, + disabled: true, dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small' @@ -301,6 +304,7 @@ define([ cls: 'btn-toolbar x-huge icon-top', iconCls: 'toolbar__icon save-form', caption: this.capBtnSaveForm, + disabled: true, dataHint: '1', dataHintDirection: 'bottom', dataHintOffset: 'small'