[DE] Show footnote tooltip. Debug applying note settings.
Fix fast mousemove from one footnote/hyperlink to another.
This commit is contained in:
parent
e93ec60426
commit
96dba54f6d
|
@ -120,8 +120,8 @@
|
||||||
this.getBSTip().show(at);
|
this.getBSTip().show(at);
|
||||||
},
|
},
|
||||||
|
|
||||||
hide: function() {
|
hide: function(callback) {
|
||||||
this.getBSTip().hide();
|
this.getBSTip().hide(callback);
|
||||||
},
|
},
|
||||||
|
|
||||||
setTitle: function(title) {
|
setTitle: function(title) {
|
||||||
|
|
|
@ -50,3 +50,7 @@
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
max-width: 300px;
|
max-width: 300px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.link-tooltip .tooltip-inner {
|
||||||
|
max-width: 500px;
|
||||||
|
}
|
|
@ -2013,12 +2013,9 @@ define([
|
||||||
api: me.api,
|
api: me.api,
|
||||||
handler: function(result, settings) {
|
handler: function(result, settings) {
|
||||||
if (settings) {
|
if (settings) {
|
||||||
if (result == 'insert') {
|
me.api.asc_SetFootnoteProps(settings.props, settings.applyToAll);
|
||||||
me.api.asc_SetFootnoteProps(settings.props);
|
if (result == 'insert')
|
||||||
me.api.asc_AddFootnote(settings.custom);
|
me.api.asc_AddFootnote(settings.custom);
|
||||||
} else if (result == 'apply') {
|
|
||||||
me.api.asc_SetFootnoteProps(settings.props);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
Common.NotificationCenter.trigger('edit:complete', me.toolbar);
|
||||||
},
|
},
|
||||||
|
|
|
@ -327,7 +327,8 @@ define([
|
||||||
toolTip: new Common.UI.Tooltip({
|
toolTip: new Common.UI.Tooltip({
|
||||||
owner: this,
|
owner: this,
|
||||||
html: true,
|
html: true,
|
||||||
title: '<br><b>Press Ctrl and click link</b>'
|
title: '<br><b>Press Ctrl and click link</b>',
|
||||||
|
cls: 'link-tooltip'
|
||||||
// style: 'word-wrap: break-word;'
|
// style: 'word-wrap: break-word;'
|
||||||
}),
|
}),
|
||||||
strTip: '',
|
strTip: '',
|
||||||
|
@ -335,7 +336,6 @@ define([
|
||||||
isVisible: false
|
isVisible: false
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
var userTooltip = true;
|
var userTooltip = true;
|
||||||
|
|
||||||
|
@ -401,7 +401,6 @@ define([
|
||||||
};
|
};
|
||||||
|
|
||||||
var onMouseMoveStart = function() {
|
var onMouseMoveStart = function() {
|
||||||
|
|
||||||
screenTip.isHidden = true;
|
screenTip.isHidden = true;
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
if (me.usertips.length>0) {
|
if (me.usertips.length>0) {
|
||||||
|
@ -418,10 +417,18 @@ define([
|
||||||
/** coauthoring end **/
|
/** coauthoring end **/
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var mouseMoveData = null,
|
||||||
|
isTooltipHiding = false;
|
||||||
|
|
||||||
var onMouseMoveEnd = function() {
|
var onMouseMoveEnd = function() {
|
||||||
if (screenTip.isHidden && screenTip.isVisible) {
|
if (screenTip.isHidden && screenTip.isVisible) {
|
||||||
screenTip.isVisible = false;
|
screenTip.isVisible = false;
|
||||||
screenTip.toolTip.hide();
|
isTooltipHiding = true;
|
||||||
|
screenTip.toolTip.hide(function(){
|
||||||
|
isTooltipHiding = false;
|
||||||
|
if (mouseMoveData) onMouseMove(mouseMoveData);
|
||||||
|
mouseMoveData = null;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -436,42 +443,63 @@ define([
|
||||||
}
|
}
|
||||||
|
|
||||||
if (moveData) {
|
if (moveData) {
|
||||||
var showPoint, ToolTip;
|
var showPoint, ToolTip,
|
||||||
|
type = moveData.get_Type();
|
||||||
|
|
||||||
if (moveData.get_Type()==1) { // 1 - hyperlink
|
if (type==1 || type==3) { // 1 - hyperlink, 3 - footnote
|
||||||
var hyperProps = moveData.get_Hyperlink();
|
if (isTooltipHiding) {
|
||||||
var recalc = false;
|
mouseMoveData = moveData;
|
||||||
if (hyperProps) {
|
return;
|
||||||
screenTip.isHidden = false;
|
|
||||||
|
|
||||||
ToolTip = (_.isEmpty(hyperProps.get_ToolTip())) ? hyperProps.get_Value() : hyperProps.get_ToolTip();
|
|
||||||
ToolTip = Common.Utils.String.htmlEncode(ToolTip);
|
|
||||||
|
|
||||||
if (screenTip.tipLength !== ToolTip.length || screenTip.strTip.indexOf(ToolTip)<0 ) {
|
|
||||||
screenTip.toolTip.setTitle(ToolTip + '<br><b>' + me.txtPressLink + '</b>');
|
|
||||||
screenTip.tipLength = ToolTip.length;
|
|
||||||
screenTip.strTip = ToolTip;
|
|
||||||
recalc = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
showPoint = [moveData.get_X(), moveData.get_Y()];
|
|
||||||
showPoint[1] += (me._XY[1]-15);
|
|
||||||
showPoint[0] += (me._XY[0]+5);
|
|
||||||
|
|
||||||
if (!screenTip.isVisible || recalc) {
|
|
||||||
screenTip.isVisible = true;
|
|
||||||
screenTip.toolTip.show([-10000, -10000]);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( recalc ) {
|
|
||||||
screenTip.tipHeight = screenTip.toolTip.getBSTip().$tip.height();
|
|
||||||
screenTip.tipWidth = screenTip.toolTip.getBSTip().$tip.width();
|
|
||||||
}
|
|
||||||
showPoint[1] -= screenTip.tipHeight;
|
|
||||||
if (showPoint[0] + screenTip.tipWidth > me._BodyWidth )
|
|
||||||
showPoint[0] = me._BodyWidth - screenTip.tipWidth;
|
|
||||||
screenTip.toolTip.getBSTip().$tip.css({top: showPoint[1] + 'px', left: showPoint[0] + 'px'});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (type==1) {
|
||||||
|
var hyperProps = moveData.get_Hyperlink();
|
||||||
|
if (!hyperProps) return;
|
||||||
|
ToolTip = (_.isEmpty(hyperProps.get_ToolTip())) ? hyperProps.get_Value() : hyperProps.get_ToolTip();
|
||||||
|
} else {
|
||||||
|
ToolTip = moveData.get_FootnoteText();
|
||||||
|
if (ToolTip.length>1000)
|
||||||
|
ToolTip = ToolTip.substr(0, 1000) + '...';
|
||||||
|
}
|
||||||
|
|
||||||
|
var recalc = false;
|
||||||
|
screenTip.isHidden = false;
|
||||||
|
|
||||||
|
ToolTip = Common.Utils.String.htmlEncode(ToolTip);
|
||||||
|
|
||||||
|
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.tipLength = ToolTip.length;
|
||||||
|
screenTip.strTip = ToolTip;
|
||||||
|
screenTip.tipType = type;
|
||||||
|
recalc = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
showPoint = [moveData.get_X(), moveData.get_Y()];
|
||||||
|
showPoint[1] += (me._XY[1]-15);
|
||||||
|
showPoint[0] += (me._XY[0]+5);
|
||||||
|
|
||||||
|
if (!screenTip.isVisible || recalc) {
|
||||||
|
screenTip.isVisible = true;
|
||||||
|
screenTip.toolTip.show([-10000, -10000]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( recalc ) {
|
||||||
|
screenTip.tipHeight = screenTip.toolTip.getBSTip().$tip.height();
|
||||||
|
screenTip.tipWidth = screenTip.toolTip.getBSTip().$tip.width();
|
||||||
|
}
|
||||||
|
|
||||||
|
recalc = false;
|
||||||
|
if (showPoint[0] + screenTip.tipWidth > me._BodyWidth ) {
|
||||||
|
showPoint[0] = me._BodyWidth - screenTip.tipWidth;
|
||||||
|
recalc = true;
|
||||||
|
}
|
||||||
|
if (showPoint[1] - screenTip.tipHeight < 0) {
|
||||||
|
showPoint[1] = (recalc) ? showPoint[1]+30 : 0;
|
||||||
|
} else
|
||||||
|
showPoint[1] -= screenTip.tipHeight;
|
||||||
|
|
||||||
|
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()==2 && me.mode.isEdit) { // 2 - locked object
|
||||||
|
|
|
@ -216,11 +216,11 @@ define([
|
||||||
menuStyle: 'min-width: 150px;',
|
menuStyle: 'min-width: 150px;',
|
||||||
editable: false,
|
editable: false,
|
||||||
data: [
|
data: [
|
||||||
{ displayValue: this.textDocument, value: Asc.section_footnote_RestartContinuous },
|
{ displayValue: this.textDocument, value: 1 },
|
||||||
{ displayValue: this.textSection, value: Asc.section_footnote_RestartEachSect }
|
{ displayValue: this.textSection, value: 0 }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
this.cmbApply.setValue(Asc.section_footnote_RestartContinuous);
|
this.cmbApply.setValue(1);
|
||||||
|
|
||||||
this.btnApply = new Common.UI.Button({
|
this.btnApply = new Common.UI.Button({
|
||||||
el: $('#note-settings-btn-apply')
|
el: $('#note-settings-btn-apply')
|
||||||
|
@ -251,11 +251,6 @@ define([
|
||||||
|
|
||||||
val = props.get_NumRestart();
|
val = props.get_NumRestart();
|
||||||
this.cmbNumbering.setValue(val);
|
this.cmbNumbering.setValue(val);
|
||||||
|
|
||||||
/*
|
|
||||||
val = props.get_ApplyTo();
|
|
||||||
this.cmbApply.setValue(val);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -270,13 +265,9 @@ define([
|
||||||
val = this.cmbFormat.getValue();
|
val = this.cmbFormat.getValue();
|
||||||
props.put_NumFormat(val);
|
props.put_NumFormat(val);
|
||||||
props.put_NumStart(this.spnStart.getNumberValue());
|
props.put_NumStart(this.spnStart.getNumberValue());
|
||||||
} else {
|
|
||||||
// props.set_Custom(val);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// props.put_ApplyTo(this.cmbApply.getValue());
|
return {props: props, applyToAll: (this.cmbApply.getValue()==1), custom: _.isEmpty(val) ? undefined : val};
|
||||||
|
|
||||||
return {props: props, custom: _.isEmpty(val) ? undefined : val};
|
|
||||||
},
|
},
|
||||||
|
|
||||||
onDlgBtnClick: function(event) {
|
onDlgBtnClick: function(event) {
|
||||||
|
|
Loading…
Reference in a new issue