[SSE] Refactoring tooltips for filters, hyperlinks
This commit is contained in:
parent
516627fa00
commit
85c47206bd
|
@ -841,14 +841,15 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
hideHyperlinkTip: function() {
|
hideHyperlinkTip: function(callback) {
|
||||||
if (!this.tooltips.hyperlink.isHidden && this.tooltips.hyperlink.ref) {
|
if (!this.tooltips.hyperlink.isHidden && this.tooltips.hyperlink.ref) {
|
||||||
this.tooltips.hyperlink.ref.hide();
|
this.tooltips.hyperlink.ref.hide(callback);
|
||||||
this.tooltips.hyperlink.isHidden = true;
|
this.tooltips.hyperlink.isHidden = true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onApiMouseMove: function(dataarray) {
|
onApiMouseMove: function(dataarray) {
|
||||||
|
var darray = dataarray;
|
||||||
if (!this._isFullscreenMenu && dataarray.length) {
|
if (!this._isFullscreenMenu && dataarray.length) {
|
||||||
var index_hyperlink,
|
var index_hyperlink,
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
|
@ -894,11 +895,66 @@ define([
|
||||||
pos = [
|
pos = [
|
||||||
me.documentHolder.cmpEl.offset().left - $(window).scrollLeft(),
|
me.documentHolder.cmpEl.offset().left - $(window).scrollLeft(),
|
||||||
me.documentHolder.cmpEl.offset().top - $(window).scrollTop()
|
me.documentHolder.cmpEl.offset().top - $(window).scrollTop()
|
||||||
];
|
],
|
||||||
|
need_return = false;
|
||||||
|
|
||||||
hyperlinkTip.isHidden = false;
|
if (this._state.index_hyperlink !== index_hyperlink ||this._state.index_comments !== index_comments ||
|
||||||
row_columnTip.isHidden = false;
|
this._state.index_locked !== index_locked || this._state.index_column !== index_column ||
|
||||||
filterTip.isHidden = false;
|
this._state.index_row !== index_row || this._state.index_filter !== index_filter) {
|
||||||
|
if (!index_hyperlink) {
|
||||||
|
need_return = true;
|
||||||
|
me.hideHyperlinkTip(function () {
|
||||||
|
me.onApiMouseMove(darray);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (index_column===undefined && index_row===undefined) {
|
||||||
|
if (!row_columnTip.isHidden && row_columnTip.ref) {
|
||||||
|
need_return = true;
|
||||||
|
row_columnTip.ref.hide(function () {
|
||||||
|
me.onApiMouseMove(darray);
|
||||||
|
});
|
||||||
|
row_columnTip.isHidden = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (me.permissions.isEdit || me.permissions.canViewComments) {
|
||||||
|
if (!index_comments || this.popupmenu) {
|
||||||
|
commentTip.moveCommentId = undefined;
|
||||||
|
if (commentTip.viewCommentId != undefined) {
|
||||||
|
commentTip = {};
|
||||||
|
|
||||||
|
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
|
||||||
|
if (commentsController) {
|
||||||
|
if (this.permissions.canCoAuthoring && this.permissions.canViewComments)
|
||||||
|
setTimeout(function() {commentsController.onApiHideComment(true);}, 200);
|
||||||
|
else
|
||||||
|
commentsController.onApiHideComment(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (me.permissions.isEdit) {
|
||||||
|
if (!index_locked) {
|
||||||
|
me.hideCoAuthTips();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (index_filter===undefined || (me.dlgFilter && me.dlgFilter.isVisible()) || (me.currentMenu && me.currentMenu.isVisible())) {
|
||||||
|
if (!filterTip.isHidden && filterTip.ref) {
|
||||||
|
need_return = true;
|
||||||
|
filterTip.ref.hide(function () {
|
||||||
|
me.onApiMouseMove(darray);
|
||||||
|
});
|
||||||
|
filterTip.isHidden = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this._state.index_hyperlink = index_hyperlink;
|
||||||
|
this._state.index_comments = index_comments;
|
||||||
|
this._state.index_locked = index_locked;
|
||||||
|
this._state.index_column = index_column;
|
||||||
|
this._state.index_row = index_row;
|
||||||
|
this._state.index_filter = index_filter;
|
||||||
|
|
||||||
|
if (need_return) return;
|
||||||
|
}
|
||||||
|
|
||||||
/** coauthoring begin **/
|
/** coauthoring begin **/
|
||||||
var getUserName = function(id){
|
var getUserName = function(id){
|
||||||
|
@ -942,28 +998,28 @@ define([
|
||||||
html : true,
|
html : true,
|
||||||
title : linkstr
|
title : linkstr
|
||||||
}).on('tooltip:hide', function(tip) {
|
}).on('tooltip:hide', function(tip) {
|
||||||
|
if (tip !== hyperlinkTip) return;
|
||||||
hyperlinkTip.ref = undefined;
|
hyperlinkTip.ref = undefined;
|
||||||
hyperlinkTip.text = '';
|
hyperlinkTip.text = '';
|
||||||
});
|
});
|
||||||
|
|
||||||
hyperlinkTip.ref.show([-10000, -10000]);
|
hyperlinkTip.ref.show([-10000, -10000]);
|
||||||
hyperlinkTip.isHidden = false;
|
hyperlinkTip.isHidden = false;
|
||||||
|
|
||||||
|
showPoint = [data.asc_getX(), data.asc_getY()];
|
||||||
|
showPoint[0] += (pos[0] + 6);
|
||||||
|
showPoint[1] += (pos[1] - 20);
|
||||||
|
showPoint[1] -= hyperlinkTip.ref.getBSTip().$tip.height();
|
||||||
|
var tipwidth = hyperlinkTip.ref.getBSTip().$tip.width();
|
||||||
|
if (showPoint[0] + tipwidth > me.tooltips.coauth.bodyWidth )
|
||||||
|
showPoint[0] = me.tooltips.coauth.bodyWidth - tipwidth;
|
||||||
|
|
||||||
|
hyperlinkTip.ref.getBSTip().$tip.css({
|
||||||
|
top : showPoint[1] + 'px',
|
||||||
|
left: showPoint[0] + 'px'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
showPoint = [data.asc_getX(), data.asc_getY()];
|
|
||||||
showPoint[0] += (pos[0] + 6);
|
|
||||||
showPoint[1] += (pos[1] - 20);
|
|
||||||
showPoint[1] -= hyperlinkTip.ref.getBSTip().$tip.height();
|
|
||||||
var tipwidth = hyperlinkTip.ref.getBSTip().$tip.width();
|
|
||||||
if (showPoint[0] + tipwidth > me.tooltips.coauth.bodyWidth )
|
|
||||||
showPoint[0] = me.tooltips.coauth.bodyWidth - tipwidth;
|
|
||||||
|
|
||||||
hyperlinkTip.ref.getBSTip().$tip.css({
|
|
||||||
top : showPoint[1] + 'px',
|
|
||||||
left: showPoint[0] + 'px'
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
me.hideHyperlinkTip();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (index_column!==undefined || index_row!==undefined) {
|
if (index_column!==undefined || index_row!==undefined) {
|
||||||
|
@ -984,6 +1040,7 @@ define([
|
||||||
html : true,
|
html : true,
|
||||||
title : str
|
title : str
|
||||||
}).on('tooltip:hide', function(tip) {
|
}).on('tooltip:hide', function(tip) {
|
||||||
|
if (tip !== row_columnTip) return;
|
||||||
row_columnTip.ref = undefined;
|
row_columnTip.ref = undefined;
|
||||||
row_columnTip.text = '';
|
row_columnTip.text = '';
|
||||||
});
|
});
|
||||||
|
@ -1004,12 +1061,7 @@ define([
|
||||||
left: showPoint[0] + 'px'
|
left: showPoint[0] + 'px'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
} else
|
||||||
if (!row_columnTip.isHidden && row_columnTip.ref) {
|
|
||||||
row_columnTip.ref.hide();
|
|
||||||
row_columnTip.isHidden = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (me.permissions.isEdit || me.permissions.canViewComments) {
|
if (me.permissions.isEdit || me.permissions.canViewComments) {
|
||||||
if (index_comments && !this.popupmenu) {
|
if (index_comments && !this.popupmenu) {
|
||||||
|
@ -1039,19 +1091,6 @@ define([
|
||||||
}
|
}
|
||||||
}, 400);
|
}, 400);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
commentTip.moveCommentId = undefined;
|
|
||||||
if (commentTip.viewCommentId != undefined) {
|
|
||||||
commentTip = {};
|
|
||||||
|
|
||||||
var commentsController = this.getApplication().getController('Common.Controllers.Comments');
|
|
||||||
if (commentsController) {
|
|
||||||
if (this.permissions.canCoAuthoring && this.permissions.canViewComments)
|
|
||||||
setTimeout(function() {commentsController.onApiHideComment(true);}, 200);
|
|
||||||
else
|
|
||||||
commentsController.onApiHideComment(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1105,8 +1144,6 @@ define([
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
me.hideCoAuthTips();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1129,6 +1166,7 @@ define([
|
||||||
title : str,
|
title : str,
|
||||||
cls: 'auto-tooltip'
|
cls: 'auto-tooltip'
|
||||||
}).on('tooltip:hide', function(tip) {
|
}).on('tooltip:hide', function(tip) {
|
||||||
|
if (tip !== filterTip) return;
|
||||||
filterTip.ref = undefined;
|
filterTip.ref = undefined;
|
||||||
filterTip.text = '';
|
filterTip.text = '';
|
||||||
});
|
});
|
||||||
|
@ -1153,11 +1191,6 @@ define([
|
||||||
left: showPoint[0] + 'px'
|
left: showPoint[0] + 'px'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if (!filterTip.isHidden && filterTip.ref) {
|
|
||||||
filterTip.ref.hide();
|
|
||||||
filterTip.isHidden = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue