Commit 96dba54f authored by Julia Radzhabova's avatar Julia Radzhabova

[DE] Show footnote tooltip. Debug applying note settings.

Fix fast mousemove from one footnote/hyperlink to another.
parent e93ec604
...@@ -120,8 +120,8 @@ ...@@ -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 @@ ...@@ -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;
}
\ No newline at end of file
...@@ -2013,12 +2013,9 @@ define([ ...@@ -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([ ...@@ -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([ ...@@ -335,7 +336,6 @@ define([
isVisible: false isVisible: false
}; };
/** coauthoring begin **/ /** coauthoring begin **/
var userTooltip = true; var userTooltip = true;
...@@ -401,7 +401,6 @@ define([ ...@@ -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([ ...@@ -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,21 +443,35 @@ define([ ...@@ -436,21 +443,35 @@ 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
if (isTooltipHiding) {
mouseMoveData = moveData;
return;
}
if (type==1) {
var hyperProps = moveData.get_Hyperlink(); 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; var recalc = false;
if (hyperProps) {
screenTip.isHidden = false; screenTip.isHidden = false;
ToolTip = (_.isEmpty(hyperProps.get_ToolTip())) ? hyperProps.get_Value() : hyperProps.get_ToolTip();
ToolTip = Common.Utils.String.htmlEncode(ToolTip); ToolTip = Common.Utils.String.htmlEncode(ToolTip);
if (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(ToolTip + '<br><b>' + me.txtPressLink + '</b>'); screenTip.toolTip.setTitle((type==1) ? (ToolTip + '<br><b>' + me.txtPressLink + '</b>') : ToolTip);
screenTip.tipLength = ToolTip.length; screenTip.tipLength = ToolTip.length;
screenTip.strTip = ToolTip; screenTip.strTip = ToolTip;
screenTip.tipType = type;
recalc = true; recalc = true;
} }
...@@ -467,11 +488,18 @@ define([ ...@@ -467,11 +488,18 @@ define([
screenTip.tipHeight = screenTip.toolTip.getBSTip().$tip.height(); screenTip.tipHeight = screenTip.toolTip.getBSTip().$tip.height();
screenTip.tipWidth = screenTip.toolTip.getBSTip().$tip.width(); screenTip.tipWidth = screenTip.toolTip.getBSTip().$tip.width();
} }
showPoint[1] -= screenTip.tipHeight;
if (showPoint[0] + screenTip.tipWidth > me._BodyWidth ) recalc = false;
if (showPoint[0] + screenTip.tipWidth > me._BodyWidth ) {
showPoint[0] = me._BodyWidth - screenTip.tipWidth; showPoint[0] = me._BodyWidth - screenTip.tipWidth;
screenTip.toolTip.getBSTip().$tip.css({top: showPoint[1] + 'px', left: showPoint[0] + 'px'}); 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([ ...@@ -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([ ...@@ -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([ ...@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment