2020-10-07 07:43:34 +00:00
|
|
|
/*
|
|
|
|
*
|
|
|
|
* (c) Copyright Ascensio System SIA 2010-2020
|
|
|
|
*
|
|
|
|
* This program is a free software product. You can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Affero General Public License (AGPL)
|
|
|
|
* version 3 as published by the Free Software Foundation. In accordance with
|
|
|
|
* Section 7(a) of the GNU AGPL its Section 15 shall be amended to the effect
|
|
|
|
* that Ascensio System SIA expressly excludes the warranty of non-infringement
|
|
|
|
* of any third-party rights.
|
|
|
|
*
|
|
|
|
* This program is distributed WITHOUT ANY WARRANTY; without even the implied
|
|
|
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For
|
|
|
|
* details, see the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
|
|
|
|
*
|
|
|
|
* You can contact Ascensio System SIA at 20A-12 Ernesta Birznieka-Upisha
|
|
|
|
* street, Riga, Latvia, EU, LV-1050.
|
|
|
|
*
|
|
|
|
* The interactive user interfaces in modified source and object code versions
|
|
|
|
* of the Program must display Appropriate Legal Notices, as required under
|
|
|
|
* Section 5 of the GNU AGPL version 3.
|
|
|
|
*
|
|
|
|
* Pursuant to Section 7(b) of the License you must retain the original Product
|
|
|
|
* logo when distributing the program. Pursuant to Section 7(e) we decline to
|
|
|
|
* grant you any rights under trademark law for use of our trademarks.
|
|
|
|
*
|
|
|
|
* All the Product's GUI elements, including illustrations and icon sets, as
|
|
|
|
* well as technical writing content are licensed under the terms of the
|
|
|
|
* Creative Commons Attribution-ShareAlike 4.0 International. See the License
|
|
|
|
* terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* FormsTab.js
|
|
|
|
*
|
|
|
|
* Created by Julia Radzhabova on 06.10.2020
|
|
|
|
* Copyright (c) 2020 Ascensio System SIA. All rights reserved.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
define([
|
|
|
|
'core',
|
|
|
|
'documenteditor/main/app/view/FormsTab'
|
|
|
|
], function () {
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
DE.Controllers.FormsTab = Backbone.Controller.extend(_.extend({
|
|
|
|
models : [],
|
|
|
|
collections : [
|
|
|
|
],
|
|
|
|
views : [
|
|
|
|
'FormsTab'
|
|
|
|
],
|
|
|
|
sdkViewName : '#id_main',
|
|
|
|
|
|
|
|
initialize: function () {
|
|
|
|
},
|
|
|
|
onLaunch: function () {
|
2021-12-29 10:14:42 +00:00
|
|
|
this._state = {};
|
2020-10-07 07:43:34 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
setApi: function (api) {
|
|
|
|
if (api) {
|
|
|
|
this.api = api;
|
|
|
|
this.api.asc_registerCallback('asc_onFocusObject', this.onApiFocusObject.bind(this));
|
|
|
|
this.api.asc_registerCallback('asc_onCoAuthoringDisconnect',_.bind(this.onCoAuthoringDisconnect, this));
|
|
|
|
Common.NotificationCenter.on('api:disconnect', _.bind(this.onCoAuthoringDisconnect, this));
|
2020-10-15 20:42:48 +00:00
|
|
|
this.api.asc_registerCallback('asc_onChangeSpecialFormsGlobalSettings', _.bind(this.onChangeSpecialFormsGlobalSettings, this));
|
|
|
|
Common.NotificationCenter.on('app:ready', this.onAppReady.bind(this));
|
2021-02-09 10:31:05 +00:00
|
|
|
this.api.asc_registerCallback('asc_onStartAction', _.bind(this.onLongActionBegin, this));
|
|
|
|
this.api.asc_registerCallback('asc_onEndAction', _.bind(this.onLongActionEnd, this));
|
|
|
|
this.api.asc_registerCallback('asc_onError', _.bind(this.onError, this));
|
2021-10-20 13:26:55 +00:00
|
|
|
this.api.asc_registerCallback('asc_onDownloadUrl', _.bind(this.onDownloadUrl, this));
|
2020-10-07 11:20:14 +00:00
|
|
|
|
2020-10-07 07:43:34 +00:00
|
|
|
// this.api.asc_registerCallback('asc_onShowContentControlsActions',_.bind(this.onShowContentControlsActions, this));
|
|
|
|
// this.api.asc_registerCallback('asc_onHideContentControlsActions',_.bind(this.onHideContentControlsActions, this));
|
|
|
|
}
|
|
|
|
return this;
|
|
|
|
},
|
|
|
|
|
|
|
|
setConfig: function(config) {
|
|
|
|
this.toolbar = config.toolbar;
|
2021-02-04 20:19:43 +00:00
|
|
|
this.appConfig = config.config;
|
2020-10-07 07:43:34 +00:00
|
|
|
this.view = this.createView('FormsTab', {
|
2021-02-04 20:19:43 +00:00
|
|
|
toolbar: this.toolbar.toolbar,
|
|
|
|
config: config.config
|
2020-10-07 07:43:34 +00:00
|
|
|
});
|
2020-10-07 11:20:14 +00:00
|
|
|
this.addListeners({
|
|
|
|
'FormsTab': {
|
|
|
|
'forms:insert': this.onControlsSelect,
|
|
|
|
'forms:clear': this.onClearClick,
|
|
|
|
'forms:no-color': this.onNoControlsColor,
|
|
|
|
'forms:select-color': this.onSelectControlsColor,
|
2021-02-04 20:19:43 +00:00
|
|
|
'forms:mode': this.onModeClick,
|
|
|
|
'forms:goto': this.onGoTo,
|
2021-09-22 16:17:14 +00:00
|
|
|
'forms:submit': this.onSubmitClick,
|
|
|
|
'forms:save': this.onSaveFormClick
|
2021-11-09 15:39:35 +00:00
|
|
|
},
|
|
|
|
'Toolbar': {
|
|
|
|
'tab:active': this.onActiveTab
|
2020-10-07 11:20:14 +00:00
|
|
|
}
|
|
|
|
});
|
2020-10-07 07:43:34 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
SetDisabled: function(state) {
|
|
|
|
this.view && this.view.SetDisabled(state);
|
|
|
|
},
|
|
|
|
|
2021-02-04 20:19:43 +00:00
|
|
|
createToolbarPanel: function() {
|
|
|
|
return this.view.getPanel();
|
|
|
|
},
|
|
|
|
|
2020-10-07 07:43:34 +00:00
|
|
|
getView: function(name) {
|
|
|
|
return !name && this.view ?
|
|
|
|
this.view : Backbone.Controller.prototype.getView.call(this, name);
|
|
|
|
},
|
|
|
|
|
|
|
|
onCoAuthoringDisconnect: function() {
|
|
|
|
this.SetDisabled(true);
|
|
|
|
},
|
|
|
|
|
|
|
|
onApiFocusObject: function(selectedObjects) {
|
2021-02-04 20:19:43 +00:00
|
|
|
if (!this.toolbar.editMode || this.appConfig.isRestrictedEdit) return;
|
2020-10-07 07:43:34 +00:00
|
|
|
|
|
|
|
var pr, i = -1, type,
|
|
|
|
paragraph_locked = false,
|
2020-10-07 11:20:14 +00:00
|
|
|
header_locked = false;
|
2020-10-07 07:43:34 +00:00
|
|
|
|
|
|
|
while (++i < selectedObjects.length) {
|
|
|
|
type = selectedObjects[i].get_ObjectType();
|
|
|
|
pr = selectedObjects[i].get_ObjectValue();
|
|
|
|
|
|
|
|
if (type === Asc.c_oAscTypeSelectElement.Paragraph) {
|
|
|
|
paragraph_locked = pr.get_Locked();
|
|
|
|
} else if (type === Asc.c_oAscTypeSelectElement.Header) {
|
|
|
|
header_locked = pr.get_Locked();
|
|
|
|
}
|
|
|
|
}
|
2020-10-07 11:20:14 +00:00
|
|
|
var in_control = this.api.asc_IsContentControl();
|
|
|
|
var control_props = in_control ? this.api.asc_GetContentControlProperties() : null,
|
|
|
|
lock_type = (in_control&&control_props) ? control_props.get_Lock() : Asc.c_oAscSdtLockType.Unlocked,
|
|
|
|
control_plain = (in_control&&control_props) ? (control_props.get_ContentControlType()==Asc.c_oAscSdtLevelType.Inline) : false;
|
|
|
|
(lock_type===undefined) && (lock_type = Asc.c_oAscSdtLockType.Unlocked);
|
|
|
|
var content_locked = lock_type==Asc.c_oAscSdtLockType.SdtContentLocked || lock_type==Asc.c_oAscSdtLockType.ContentLocked;
|
2021-12-29 10:14:42 +00:00
|
|
|
var arr = [ this.view.btnTextField, this.view.btnComboBox, this.view.btnDropDown, this.view.btnCheckBox,
|
|
|
|
this.view.btnRadioBox, this.view.btnImageField ];
|
|
|
|
Common.Utils.lockControls(DE.enumLock.paragraphLock, paragraph_locked, {array: arr});
|
|
|
|
Common.Utils.lockControls(DE.enumLock.headerLock, header_locked, {array: arr});
|
|
|
|
Common.Utils.lockControls(DE.enumLock.controlPlain, control_plain, {array: arr});
|
|
|
|
Common.Utils.lockControls(DE.enumLock.contentLock, content_locked, {array: arr});
|
2020-10-07 11:20:14 +00:00
|
|
|
},
|
2020-10-07 07:43:34 +00:00
|
|
|
|
2020-10-15 20:42:48 +00:00
|
|
|
onChangeSpecialFormsGlobalSettings: function() {
|
2020-10-07 11:20:14 +00:00
|
|
|
if (this.view && this.view.mnuFormsColorPicker) {
|
2020-10-15 20:42:48 +00:00
|
|
|
var clr = this.api.asc_GetSpecialFormsHighlightColor(),
|
|
|
|
show = !!clr;
|
2020-10-07 11:20:14 +00:00
|
|
|
this.view.mnuNoFormsColor.setChecked(!show, true);
|
|
|
|
this.view.mnuFormsColorPicker.clearSelection();
|
2020-10-15 20:42:48 +00:00
|
|
|
if (clr) {
|
|
|
|
clr = Common.Utils.ThemeColor.getHexColor(clr.get_r(), clr.get_g(), clr.get_b());
|
|
|
|
this.view.mnuFormsColorPicker.selectByRGB(clr, true);
|
2020-10-07 11:20:14 +00:00
|
|
|
}
|
2020-10-07 13:22:59 +00:00
|
|
|
this.view.btnHighlight.currentColor = clr;
|
2021-01-21 19:48:27 +00:00
|
|
|
this.view.btnHighlight.setColor(this.view.btnHighlight.currentColor || 'transparent');
|
2020-10-07 07:43:34 +00:00
|
|
|
}
|
2020-10-07 11:20:14 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
onControlsSelect: function(type) {
|
2021-04-30 09:36:34 +00:00
|
|
|
if (!(this.toolbar.mode && this.toolbar.mode.canFeatureContentControl && this.toolbar.mode.canFeatureForms)) return;
|
2020-10-07 11:20:14 +00:00
|
|
|
|
|
|
|
var oPr,
|
|
|
|
oFormPr = new AscCommon.CSdtFormPr();
|
|
|
|
this.toolbar.toolbar.fireEvent('insertcontrol', this.toolbar.toolbar);
|
|
|
|
if (type == 'picture')
|
|
|
|
this.api.asc_AddContentControlPicture(oFormPr);
|
|
|
|
else if (type == 'checkbox' || type == 'radiobox') {
|
|
|
|
oPr = new AscCommon.CSdtCheckBoxPr();
|
2021-03-26 21:36:57 +00:00
|
|
|
(type == 'radiobox') && oPr.put_GroupKey(this.toolbar.textGroup + ' 1');
|
2020-10-07 11:20:14 +00:00
|
|
|
this.api.asc_AddContentControlCheckBox(oPr, oFormPr);
|
|
|
|
} else if (type == 'combobox' || type == 'dropdown')
|
|
|
|
this.api.asc_AddContentControlList(type == 'combobox', oPr, oFormPr);
|
|
|
|
else if (type == 'text') {
|
|
|
|
oPr = new AscCommon.CSdtTextFormPr();
|
|
|
|
this.api.asc_AddContentControlTextForm(oPr, oFormPr);
|
|
|
|
}
|
2021-11-09 15:39:35 +00:00
|
|
|
|
|
|
|
var me = this;
|
|
|
|
setTimeout(function() {
|
|
|
|
me.showSaveFormTip();
|
|
|
|
}, 500);
|
2020-10-07 07:43:34 +00:00
|
|
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
|
|
|
},
|
|
|
|
|
|
|
|
onModeClick: function(state) {
|
|
|
|
if (this.api) {
|
2020-10-08 08:11:34 +00:00
|
|
|
this.disableEditing(state);
|
|
|
|
this.api.asc_setRestriction(state ? Asc.c_oAscRestrictionType.OnlyForms : Asc.c_oAscRestrictionType.None);
|
2020-11-11 14:24:46 +00:00
|
|
|
this.api.asc_SetPerformContentControlActionByClick(state);
|
2021-07-29 15:26:31 +00:00
|
|
|
this.api.asc_SetHighlightRequiredFields(state);
|
2020-10-07 07:43:34 +00:00
|
|
|
}
|
|
|
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
|
|
|
},
|
|
|
|
|
|
|
|
onClearClick: function() {
|
|
|
|
if (this.api) {
|
2020-10-13 12:28:02 +00:00
|
|
|
this.api.asc_ClearAllSpecialForms();
|
2020-10-07 07:43:34 +00:00
|
|
|
}
|
|
|
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
|
|
|
},
|
|
|
|
|
|
|
|
onNoControlsColor: function(item) {
|
|
|
|
if (!item.isChecked())
|
2021-04-29 12:10:57 +00:00
|
|
|
this.api.asc_SetSpecialFormsHighlightColor(201, 200, 255);
|
2020-10-07 07:43:34 +00:00
|
|
|
else
|
2020-10-15 20:42:48 +00:00
|
|
|
this.api.asc_SetSpecialFormsHighlightColor();
|
2020-10-07 07:43:34 +00:00
|
|
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
|
|
|
},
|
|
|
|
|
|
|
|
onSelectControlsColor: function(color) {
|
|
|
|
var clr = Common.Utils.ThemeColor.getRgbColor(color);
|
|
|
|
if (this.api) {
|
2020-10-15 20:42:48 +00:00
|
|
|
this.api.asc_SetSpecialFormsHighlightColor(clr.get_r(), clr.get_g(), clr.get_b());
|
2020-10-07 07:43:34 +00:00
|
|
|
}
|
|
|
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
2020-10-08 08:11:34 +00:00
|
|
|
},
|
|
|
|
|
2021-02-04 20:19:43 +00:00
|
|
|
onGoTo: function(type) {
|
2021-02-05 11:16:03 +00:00
|
|
|
if (this.api)
|
|
|
|
this.api.asc_MoveToFillingForm(type=='next');
|
2021-02-04 20:19:43 +00:00
|
|
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
|
|
|
},
|
|
|
|
|
|
|
|
onSubmitClick: function() {
|
2021-06-18 08:14:43 +00:00
|
|
|
if (!this.api.asc_IsAllRequiredFormsFilled()) {
|
|
|
|
var me = this;
|
|
|
|
Common.UI.warning({
|
|
|
|
msg: this.view.textRequired,
|
|
|
|
callback: function() {
|
|
|
|
me.api.asc_MoveToFillingForm(true, true, true);
|
|
|
|
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-02-09 10:31:05 +00:00
|
|
|
this.api.asc_SendForm();
|
2021-02-04 20:19:43 +00:00
|
|
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
|
|
|
},
|
|
|
|
|
2021-09-22 16:17:14 +00:00
|
|
|
onSaveFormClick: function() {
|
2021-10-20 13:26:55 +00:00
|
|
|
this.isFromFormSaveAs = this.appConfig.canRequestSaveAs || !!this.appConfig.saveAsUrl;
|
|
|
|
this.api.asc_DownloadAs(new Asc.asc_CDownloadOptions(Asc.c_oAscFileType.OFORM, this.isFromFormSaveAs));
|
|
|
|
},
|
|
|
|
|
|
|
|
onDownloadUrl: function(url, fileType) {
|
|
|
|
if (this.isFromFormSaveAs) {
|
|
|
|
var me = this,
|
|
|
|
defFileName = this.getApplication().getController('Viewport').getView('Common.Views.Header').getDocumentCaption();
|
|
|
|
!defFileName && (defFileName = me.view.txtUntitled);
|
|
|
|
|
|
|
|
var idx = defFileName.lastIndexOf('.');
|
|
|
|
if (idx>0)
|
|
|
|
defFileName = defFileName.substring(0, idx) + '.oform';
|
|
|
|
|
|
|
|
if (me.appConfig.canRequestSaveAs) {
|
|
|
|
Common.Gateway.requestSaveAs(url, defFileName, fileType);
|
|
|
|
} else {
|
|
|
|
me._saveCopyDlg = new Common.Views.SaveAsDlg({
|
|
|
|
saveFolderUrl: me.appConfig.saveAsUrl,
|
|
|
|
saveFileUrl: url,
|
|
|
|
defFileName: defFileName
|
|
|
|
});
|
|
|
|
me._saveCopyDlg.on('saveaserror', function(obj, err){
|
|
|
|
Common.UI.warning({
|
|
|
|
closable: false,
|
|
|
|
msg: err,
|
|
|
|
callback: function(btn){
|
|
|
|
Common.NotificationCenter.trigger('edit:complete', me);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}).on('close', function(obj){
|
|
|
|
me._saveCopyDlg = undefined;
|
|
|
|
});
|
|
|
|
me._saveCopyDlg.show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.isFromFormSaveAs = false;
|
2021-09-22 16:17:14 +00:00
|
|
|
},
|
|
|
|
|
2020-10-08 08:11:34 +00:00
|
|
|
disableEditing: function(disable) {
|
|
|
|
if (this._state.DisabledEditing != disable) {
|
|
|
|
this._state.DisabledEditing = disable;
|
|
|
|
|
2021-06-29 13:27:44 +00:00
|
|
|
Common.NotificationCenter.trigger('editing:disable', disable, {
|
|
|
|
viewMode: false,
|
|
|
|
reviewMode: false,
|
|
|
|
fillFormwMode: true,
|
|
|
|
allowMerge: false,
|
|
|
|
allowSignature: false,
|
|
|
|
allowProtect: false,
|
|
|
|
rightMenu: {clear: true, disable: true},
|
|
|
|
statusBar: true,
|
|
|
|
leftMenu: {disable: false, previewMode: true},
|
|
|
|
fileMenu: false,
|
|
|
|
navigation: {disable: false, previewMode: true},
|
|
|
|
comments: {disable: false, previewMode: true},
|
|
|
|
chat: false,
|
|
|
|
review: true,
|
|
|
|
viewport: false,
|
|
|
|
documentHolder: true,
|
|
|
|
toolbar: true,
|
|
|
|
plugins: false
|
2021-06-30 12:19:45 +00:00
|
|
|
}, 'forms');
|
2020-10-08 08:11:34 +00:00
|
|
|
if (this.view)
|
|
|
|
this.view.$el.find('.no-group-mask.form-view').css('opacity', 1);
|
|
|
|
}
|
2020-10-15 20:42:48 +00:00
|
|
|
},
|
|
|
|
|
2021-02-06 11:58:40 +00:00
|
|
|
onLongActionBegin: function(type, id) {
|
|
|
|
if (id==Asc.c_oAscAsyncAction['Submit'] && this.view.btnSubmit) {
|
2021-02-09 10:31:05 +00:00
|
|
|
this._submitFail = false;
|
|
|
|
this.submitedTooltip && this.submitedTooltip.hide();
|
2021-02-06 11:58:40 +00:00
|
|
|
this.view.btnSubmit.setDisabled(true);
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onLongActionEnd: function(type, id) {
|
|
|
|
if (id==Asc.c_oAscAsyncAction['Submit'] && this.view.btnSubmit) {
|
|
|
|
this.view.btnSubmit.setDisabled(false);
|
|
|
|
if (!this.submitedTooltip) {
|
|
|
|
this.submitedTooltip = new Common.UI.SynchronizeTip({
|
|
|
|
text: this.view.textSubmited,
|
|
|
|
extCls: 'no-arrow',
|
2021-02-08 14:29:18 +00:00
|
|
|
showLink: false,
|
2021-02-08 16:19:19 +00:00
|
|
|
target: $('.toolbar'),
|
|
|
|
placement: 'bottom'
|
2021-02-06 11:58:40 +00:00
|
|
|
});
|
|
|
|
this.submitedTooltip.on('closeclick', function () {
|
|
|
|
this.submitedTooltip.hide();
|
|
|
|
}, this);
|
|
|
|
}
|
2021-02-09 10:31:05 +00:00
|
|
|
!this._submitFail && this.submitedTooltip.show();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
onError: function(id, level, errData) {
|
|
|
|
if (id==Asc.c_oAscError.ID.Submit) {
|
|
|
|
this._submitFail = true;
|
|
|
|
this.submitedTooltip && this.submitedTooltip.hide();
|
2021-02-06 11:58:40 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2020-10-15 20:42:48 +00:00
|
|
|
onAppReady: function (config) {
|
|
|
|
var me = this;
|
|
|
|
(new Promise(function (accept, reject) {
|
|
|
|
accept();
|
|
|
|
})).then(function(){
|
2021-02-04 20:19:43 +00:00
|
|
|
if (config.canEditContentControl && me.view.btnHighlight) {
|
2020-10-15 20:42:48 +00:00
|
|
|
var clr = me.api.asc_GetSpecialFormsHighlightColor();
|
|
|
|
clr && (clr = Common.Utils.ThemeColor.getHexColor(clr.get_r(), clr.get_g(), clr.get_b()));
|
|
|
|
me.view.btnHighlight.currentColor = clr;
|
|
|
|
}
|
2021-10-28 13:41:06 +00:00
|
|
|
config.isEdit && config.canFeatureContentControl && config.isFormCreator && me.showCreateFormTip(); // show tip only when create form in docxf
|
2020-10-15 20:42:48 +00:00
|
|
|
});
|
2021-10-28 13:41:06 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
showCreateFormTip: function() {
|
|
|
|
if (!Common.localStorage.getItem("de-hide-createform-tip")) {
|
|
|
|
var target = $('.toolbar').find('.ribtab [data-tab=forms]').parent();
|
|
|
|
var tip = new Common.UI.SynchronizeTip({
|
|
|
|
extCls: 'colored',
|
|
|
|
placement: 'bottom-right',
|
|
|
|
target: target,
|
|
|
|
text: this.view.textCreateForm,
|
2021-10-29 15:50:41 +00:00
|
|
|
showLink: false,
|
2021-10-29 15:33:03 +00:00
|
|
|
closable: false,
|
2021-10-29 15:50:41 +00:00
|
|
|
showButton: true,
|
|
|
|
textButton: this.view.textGotIt
|
2021-10-28 13:41:06 +00:00
|
|
|
});
|
|
|
|
tip.on({
|
2021-10-29 15:50:41 +00:00
|
|
|
'buttonclick': function() {
|
2021-10-28 13:41:06 +00:00
|
|
|
Common.localStorage.setItem("de-hide-createform-tip", 1);
|
|
|
|
tip.close();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
tip.show();
|
|
|
|
}
|
2021-11-09 15:39:35 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
showSaveFormTip: function() {
|
2021-11-15 18:05:27 +00:00
|
|
|
if (this.view.btnSaveForm && !Common.localStorage.getItem("de-hide-saveform-tip") && !this.tipSaveForm) {
|
2021-11-09 15:39:35 +00:00
|
|
|
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();
|
|
|
|
}
|
2020-10-07 07:43:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}, DE.Controllers.FormsTab || {}));
|
|
|
|
});
|