From 821fb33e10f7e30d744291c9599a4ef06f16f653 Mon Sep 17 00:00:00 2001 From: "Julia.Radzhabova" Date: Mon, 30 Jun 2025 17:33:45 +0300 Subject: [PATCH 1/2] For bug 74201 --- .../main/app/template/FormSettings.template | 6 +++++ apps/pdfeditor/main/app/view/FormSettings.js | 26 +++++++++++++++++++ apps/pdfeditor/main/app_dev.js | 1 + apps/pdfeditor/main/app_pack.js | 1 + apps/pdfeditor/main/locale/en.json | 1 + 5 files changed, 35 insertions(+) diff --git a/apps/pdfeditor/main/app/template/FormSettings.template b/apps/pdfeditor/main/app/template/FormSettings.template index 85c0711585..c7e1dd36ea 100644 --- a/apps/pdfeditor/main/app/template/FormSettings.template +++ b/apps/pdfeditor/main/app/template/FormSettings.template @@ -16,6 +16,12 @@
+ + + +
+ + diff --git a/apps/pdfeditor/main/app/view/FormSettings.js b/apps/pdfeditor/main/app/view/FormSettings.js index 369b5bd73e..c8a51b3b74 100644 --- a/apps/pdfeditor/main/app/view/FormSettings.js +++ b/apps/pdfeditor/main/app/view/FormSettings.js @@ -241,6 +241,18 @@ define([ setTimeout(function(){me.txtPlaceholder._input && me.txtPlaceholder._input.select();}, 1); }); + this.textareaTip = new Common.UI.TextareaField({ + el : $markup.findById('#form-txt-tip'), + style : 'width: 100%; height: 36px;', + value : '', + dataHint : '1', + dataHintDirection: 'left', + dataHintOffset: 'small' + }); + this.lockedControls.push(this.textareaTip); + this.textareaTip.on('changed:after', this.onTipChanged.bind(this)); + this.textareaTip.on('inputleave', function(){ me.fireEvent('editcomplete', me);}); + this.chAutofit = new Common.UI.CheckBox({ el: $markup.findById('#form-chb-autofit'), labelText: this.textAutofit, @@ -888,6 +900,14 @@ define([ } }, + onTipChanged: function(input, newValue, oldValue, e) { + if (this.api && !this._noApply && (newValue!==oldValue)) { + this.api.SetFieldTooltip(newValue); + if (!e.relatedTarget || (e.relatedTarget.localName != 'input' && e.relatedTarget.localName != 'textarea') || !/form-control/.test(e.relatedTarget.className)) + this.fireEvent('editcomplete', this); + } + }, + onLineWidthChanged: function(combo, record) { if (this.api && !this._noApply) { this._state.StrokeWidth = undefined; @@ -1314,6 +1334,12 @@ define([ this._state.Name=val; } + val = props.asc_getTooltip(); + if (this._state.tip!==val) { + this.textareaTip.setValue(val ? val : ''); + this._state.tip=val; + } + val = props.asc_getRequired(); if ( this._state.Required!==val ) { this.chRequired.setValue(!!val, true); diff --git a/apps/pdfeditor/main/app_dev.js b/apps/pdfeditor/main/app_dev.js index e85a43d953..42b754e7cf 100644 --- a/apps/pdfeditor/main/app_dev.js +++ b/apps/pdfeditor/main/app_dev.js @@ -203,6 +203,7 @@ require([ 'common/main/lib/view/ListSettingsDialog', 'common/main/lib/view/CustomizeQuickAccessDialog', 'common/main/lib/view/PasswordDialog', + 'common/main/lib/component/TextareaField', 'pdfeditor/main/app/controller/DocumentHolderExt', 'pdfeditor/main/app/view/FileMenuPanels', diff --git a/apps/pdfeditor/main/app_pack.js b/apps/pdfeditor/main/app_pack.js index b016dfbc53..ad75f88ea7 100644 --- a/apps/pdfeditor/main/app_pack.js +++ b/apps/pdfeditor/main/app_pack.js @@ -20,6 +20,7 @@ require([ 'common/main/lib/view/ListSettingsDialog', 'common/main/lib/view/CustomizeQuickAccessDialog', 'common/main/lib/view/PasswordDialog', + 'common/main/lib/component/TextareaField', 'pdfeditor/main/app/controller/DocumentHolderExt', 'pdfeditor/main/app/view/FileMenuPanels', diff --git a/apps/pdfeditor/main/locale/en.json b/apps/pdfeditor/main/locale/en.json index ef4a57e791..1c9c63b07c 100644 --- a/apps/pdfeditor/main/locale/en.json +++ b/apps/pdfeditor/main/locale/en.json @@ -1519,6 +1519,7 @@ "PDFE.Views.FormSettings.textZipCode": "ZIP Code", "PDFE.Views.FormSettings.textZipCode4": "ZIP Code + 4", "PDFE.Views.FormSettings.txtCustom": "Custom", + "PDFE.Views.FormSettings.textTip": "Tip", "PDFE.Views.FormsTab.capBtnCheckBox": "Checkbox", "PDFE.Views.FormsTab.capBtnComboBox": "Combo Box", "PDFE.Views.FormsTab.capBtnDropDown": "List Box", From 3e1b78429b7f8d1aec1867ebee2521439ec9bcea Mon Sep 17 00:00:00 2001 From: "Julia.Radzhabova" Date: Mon, 30 Jun 2025 23:18:57 +0300 Subject: [PATCH 2/2] [PDF] Fix tooltip style --- apps/pdfeditor/main/app/controller/DocumentHolder.js | 5 ----- .../main/app/controller/DocumentHolderExt.js | 12 +++++++++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/apps/pdfeditor/main/app/controller/DocumentHolder.js b/apps/pdfeditor/main/app/controller/DocumentHolder.js index 7da97b978e..3c6c3524fa 100644 --- a/apps/pdfeditor/main/app/controller/DocumentHolder.js +++ b/apps/pdfeditor/main/app/controller/DocumentHolder.js @@ -103,11 +103,6 @@ define([ isVisible: false }; me.eyedropperTip = { - toolTip: new Common.UI.Tooltip({ - owner: this, - html: true, - cls: 'eyedropper-tooltip' - }), isHidden: true, isVisible: false, eyedropperColor: null, diff --git a/apps/pdfeditor/main/app/controller/DocumentHolderExt.js b/apps/pdfeditor/main/app/controller/DocumentHolderExt.js index 5fc29b439e..8ea41dfaf5 100644 --- a/apps/pdfeditor/main/app/controller/DocumentHolderExt.js +++ b/apps/pdfeditor/main/app/controller/DocumentHolderExt.js @@ -1189,6 +1189,16 @@ define([], function () { me.eyedropperTip.toolTip.hide(); } + if (!me.eyedropperTip.toolTip) { + var tipEl = $('
'); + me.documentHolder.cmpEl.append(tipEl); + me.eyedropperTip.toolTip = new Common.UI.Tooltip({ + owner: tipEl, + html: true, + cls: 'eyedropper-tooltip' + }); + } + var color = moveData.get_EyedropperColor().asc_getColor(), r = color.get_r(), g = color.get_g(), @@ -1214,7 +1224,7 @@ define([], function () { me.eyedropperTip.tipInterval = setInterval(function () { clearInterval(me.eyedropperTip.tipInterval); if (me.eyedropperTip.isVisible) { - ToolTip = '
RGB(' + r + ',' + g + ',' + b + ')
' + + ToolTip = '
RGB (' + r + ',' + g + ',' + b + ')
' + '
' + moveData.get_EyedropperColor().asc_getName() + '
'; me.eyedropperTip.toolTip.setTitle(ToolTip); me.eyedropperTip.isTipVisible = true;