Merge pull request #1296 from ONLYOFFICE/fix/save-form-tip

Fix/save form tip
This commit is contained in:
Julia Radzhabova 2021-11-09 18:50:59 +03:00 committed by GitHub
commit 3920fbff5f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 41 additions and 0 deletions

View file

@ -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 || {}));

View file

@ -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'