[SSE] Update bootstrap (fix menu-formula-selection)

This commit is contained in:
JuliaSvinareva 2020-12-12 19:41:32 +03:00
parent f03bcd0e3a
commit 292831de78
5 changed files with 26 additions and 50 deletions

View file

@ -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'
});
}

View file

@ -112,6 +112,21 @@ define([
'<div class="tooltip" role="tooltip"><div class="tooltip-inner"></div></div>';
}
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);

View file

@ -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;

View file

@ -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);
}
},

View file

@ -2274,7 +2274,7 @@ define([
if (!menu.rendered) {
// Prepare menu container
if (menuContainer.length < 1) {
menuContainer = $(Common.Utils.String.format('<div id="menu-formula-selection" style="position: absolute; z-index: 10000;" class="no-stop-propagate"><div class="dropdown-toggle" data-toggle="dropdown"></div></div>'));
menuContainer = $(Common.Utils.String.format('<div id="menu-formula-selection" style="position: absolute; z-index: 10000;" class="no-stop-propagate dropdown"><a href="#" class="dropdown-toggle d-none" data-toggle="dropdown"></a></div>'));
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(),