[DE] Show help tooltip for new forms

This commit is contained in:
Julia Radzhabova 2020-10-12 14:58:13 +03:00
parent 51b1cedb42
commit e9f9aa1c16

View file

@ -491,20 +491,24 @@ define([
var showPoint, ToolTip, var showPoint, ToolTip,
type = moveData.get_Type(); type = moveData.get_Type();
if (type==1 || type==3) { // 1 - hyperlink, 3 - footnote if (type==Asc.c_oAscMouseMoveDataTypes.Hyperlink || type==Asc.c_oAscMouseMoveDataTypes.Footnote || type==Asc.c_oAscMouseMoveDataTypes.Form) { // 1 - hyperlink, 3 - footnote
if (isTooltipHiding) { if (isTooltipHiding) {
mouseMoveData = moveData; mouseMoveData = moveData;
return; return;
} }
if (type==1) { if (type==Asc.c_oAscMouseMoveDataTypes.Hyperlink) {
var hyperProps = moveData.get_Hyperlink(); var hyperProps = moveData.get_Hyperlink();
if (!hyperProps) return; if (!hyperProps) return;
ToolTip = (_.isEmpty(hyperProps.get_ToolTip())) ? hyperProps.get_Value() : hyperProps.get_ToolTip(); ToolTip = (_.isEmpty(hyperProps.get_ToolTip())) ? hyperProps.get_Value() : hyperProps.get_ToolTip();
} else { } else if (type == Asc.c_oAscMouseMoveDataTypes.Footnote) {
ToolTip = moveData.get_FootnoteText(); ToolTip = moveData.get_FootnoteText();
if (ToolTip.length>1000) if (ToolTip.length>1000)
ToolTip = ToolTip.substr(0, 1000) + '...'; ToolTip = ToolTip.substr(0, 1000) + '...';
} else if (type==Asc.c_oAscMouseMoveDataTypes.Form) {
ToolTip = moveData.get_FormHelpText();
if (ToolTip.length>1000)
ToolTip = ToolTip.substr(0, 1000) + '...';
} }
var recalc = false; var recalc = false;
@ -513,7 +517,7 @@ define([
ToolTip = Common.Utils.String.htmlEncode(ToolTip); ToolTip = Common.Utils.String.htmlEncode(ToolTip);
if (screenTip.tipType !== type || screenTip.tipLength !== ToolTip.length || screenTip.strTip.indexOf(ToolTip)<0 ) { if (screenTip.tipType !== type || screenTip.tipLength !== ToolTip.length || screenTip.strTip.indexOf(ToolTip)<0 ) {
screenTip.toolTip.setTitle((type==1) ? (ToolTip + '<br><b>' + me.txtPressLink + '</b>') : ToolTip); screenTip.toolTip.setTitle((type==Asc.c_oAscMouseMoveDataTypes.Hyperlink) ? (ToolTip + '<br><b>' + me.txtPressLink + '</b>') : ToolTip);
screenTip.tipLength = ToolTip.length; screenTip.tipLength = ToolTip.length;
screenTip.strTip = ToolTip; screenTip.strTip = ToolTip;
screenTip.tipType = type; screenTip.tipType = type;
@ -547,7 +551,7 @@ define([
screenTip.toolTip.getBSTip().$tip.css({top: showPoint[1] + 'px', left: showPoint[0] + 'px'}); screenTip.toolTip.getBSTip().$tip.css({top: showPoint[1] + 'px', left: showPoint[0] + 'px'});
} }
/** coauthoring begin **/ /** coauthoring begin **/
else if (moveData.get_Type()==2 && me.mode.isEdit) { // 2 - locked object else if (moveData.get_Type()==Asc.c_oAscMouseMoveDataTypes.LockedObject && me.mode.isEdit) { // 2 - locked object
var src; var src;
if (me.usertipcount >= me.usertips.length) { if (me.usertipcount >= me.usertips.length) {
src = $(document.createElement("div")); src = $(document.createElement("div"));