diff --git a/apps/common/main/lib/component/MenuItem.js b/apps/common/main/lib/component/MenuItem.js
index cd208acdb..855f0be06 100644
--- a/apps/common/main/lib/component/MenuItem.js
+++ b/apps/common/main/lib/component/MenuItem.js
@@ -195,22 +195,8 @@ define([
el.attr('data-toggle', 'tooltip');
el.tooltip({
title : me.options.hint,
- placement : me.options.hintAnchor||function(tip, element) {
- var pos = this.getPosition(),
- actualWidth = tip.offsetWidth,
- actualHeight = tip.offsetHeight,
- innerWidth = Common.Utils.innerWidth(),
- innerHeight = Common.Utils.innerHeight();
- var top = pos.top,
- left = pos.left + pos.width + 2;
- if (top + actualHeight > innerHeight) {
- top = innerHeight - actualHeight - 2;
- }
- if (left + actualWidth > innerWidth) {
- left = pos.left - actualWidth - 2;
- }
- $(tip).offset({top: top,left: left}).addClass('in');
- }
+ placement : me.options.hintAnchor || 'right',
+ offset : '0, 2'
});
}
diff --git a/apps/common/main/lib/util/Tip.js b/apps/common/main/lib/util/Tip.js
index 9671d927a..22a9e1a9b 100644
--- a/apps/common/main/lib/util/Tip.js
+++ b/apps/common/main/lib/util/Tip.js
@@ -112,6 +112,21 @@ define([
'
';
}
this.config = this._getConfig(config);
+ this.config.popperConfig = {
+ modifiers: {
+ flip: {
+ enabled: config.flip ? config.flip.enabled : true,
+ behavior: this.config.fallbackPlacement,
+ boundariesElement: $('#viewport')[0]
+ },
+ arrow: {
+ enabled: !!config.arrow
+ },
+ offset: {
+ offset: config.offset ? config.offset : 0
+ }
+ }
+ };
this.tip = null;
this._setListeners();
@@ -301,36 +316,6 @@ define([
}, context.config.delay.show);
},
- _getPopperConfig: function (attachment) {
- var me = this;
- var config = {
- placement: attachment,
- modifiers: {
- offset: this._getOffset(),
- flip: {
- behavior: this.config.fallbackPlacement
- },
- preventOverflow: {
- boundariesElement: this.config.boundary
- }
- },
- onCreate: function onCreate(data) {
- if (data.originalPlacement !== data.placement) {
- me._handlePopperPlacementChange(data);
- }
- },
- onUpdate: function onUpdate(data) {
- return me._handlePopperPlacementChange(data);
- }
- };
- if (this.config.arrow) {
- config.modifiers.arrow = {
- element: '.arrow'
- };
- }
- return config;
- }
-
/*_getOffset: function (placement, pos, actualWidth, actualHeight) {
var out = _superclass.prototype.getCalculatedOffset.apply(this, arguments);
diff --git a/apps/common/main/resources/less/tooltip.less b/apps/common/main/resources/less/tooltip.less
index cd0aea8ce..8e1e08917 100644
--- a/apps/common/main/resources/less/tooltip.less
+++ b/apps/common/main/resources/less/tooltip.less
@@ -35,13 +35,16 @@
border-bottom-color: @body-bg;
}
}
-
+.tooltip {
+ z-index: 1000;
+}
.tooltip-inner {
font-size: 11px;
background-color: @body-bg;
color: @gray-deep;
padding: 5px 12px;
border: 1px solid rgba(0, 0, 0, 0.15);
+ border-radius: 4px;
.box-shadow(0 6px 12px rgba(0, 0, 0, 0.175));
background-clip: padding-box;
diff --git a/apps/spreadsheeteditor/main/app/controller/CellEditor.js b/apps/spreadsheeteditor/main/app/controller/CellEditor.js
index cb92d6915..ee6381bcb 100644
--- a/apps/spreadsheeteditor/main/app/controller/CellEditor.js
+++ b/apps/spreadsheeteditor/main/app/controller/CellEditor.js
@@ -109,7 +109,7 @@ define([
Common.UI.Keys.TAB === e.keyCode || Common.UI.Keys.RETURN === e.keyCode || Common.UI.Keys.ESC === e.keyCode ||
Common.UI.Keys.LEFT === e.keyCode || Common.UI.Keys.RIGHT === e.keyCode) {
var menu = $('#menu-formula-selection'); // for formula menu
- if (menu.hasClass('open'))
+ if (menu.hasClass('show'))
menu.find('.dropdown-menu').trigger('keydown', e);
}
},
diff --git a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
index 82c2e8d34..1c1128a7f 100644
--- a/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
+++ b/apps/spreadsheeteditor/main/app/controller/DocumentHolder.js
@@ -2274,7 +2274,7 @@ define([
if (!menu.rendered) {
// Prepare menu container
if (menuContainer.length < 1) {
- menuContainer = $(Common.Utils.String.format(''));
+ menuContainer = $(Common.Utils.String.format(''));
documentHolderView.cmpEl.append(menuContainer);
}
@@ -2285,7 +2285,7 @@ define([
var li;
if (arguments.length>1 && arguments[1] instanceof KeyboardEvent) // when typing in cell editor
e = arguments[1];
- if (menuContainer.hasClass('open')) {
+ if (menuContainer.hasClass('show')) {
if (e.keyCode == Common.UI.Keys.TAB || e.keyCode == Common.UI.Keys.RETURN && !e.ctrlKey && !e.altKey)
li = menuContainer.find('a.focus').closest('li');
else if (e.keyCode == Common.UI.Keys.UP || e.keyCode == Common.UI.Keys.DOWN) {
@@ -2321,6 +2321,8 @@ define([
menu.render(menuContainer);
menu.cmpEl.attr({tabindex: "-1"});
+ menu.cmpEl.data('display', 'static');
+ menu.cmpEl.css('position', 'fixed');
}
var coord = me.api.asc_getActiveCellCoord(),