From 992929c99a7afa4809a0aeeb812a244177717461 Mon Sep 17 00:00:00 2001 From: JuliaSvinareva Date: Thu, 29 Oct 2020 20:49:05 +0300 Subject: [PATCH] [SSE] Update bootstrap (fix tab menu, fix disable buttons) --- apps/common/main/lib/component/Menu.js | 8 +++++--- apps/common/main/lib/component/TabBar.js | 2 +- apps/spreadsheeteditor/main/app/view/Statusbar.js | 7 ++++++- apps/spreadsheeteditor/main/resources/less/statusbar.less | 6 +++++- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/apps/common/main/lib/component/Menu.js b/apps/common/main/lib/component/Menu.js index 82aea3018..de8f5df24 100644 --- a/apps/common/main/lib/component/Menu.js +++ b/apps/common/main/lib/component/Menu.js @@ -290,10 +290,12 @@ define([ hide: function() { if (this.rendered && this.parentEl) { - if ( this.parentEl.hasClass('show') ) - this.cmpEl.dropdown('toggle'); - else if (this.parentEl.hasClass('over')) + if ( this.parentEl.hasClass('show') ){ + this.parentEl.removeClass('show'); + this.parentEl.find('.dropdown-menu').removeClass('show'); + } else if (this.parentEl.hasClass('over')) { this.parentEl.removeClass('over'); + } } }, diff --git a/apps/common/main/lib/component/TabBar.js b/apps/common/main/lib/component/TabBar.js index 599ab11cf..62d424185 100644 --- a/apps/common/main/lib/component/TabBar.js +++ b/apps/common/main/lib/component/TabBar.js @@ -649,7 +649,7 @@ define([ //left = tab.position().left; //right = left + tab.width(); - return !(left < leftbound) && !(right - rightbound > 0.5); + return !(leftbound - left > 0.5) && !(right - rightbound > 0.5); } return false; diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js index 0a36d42b1..d19152259 100644 --- a/apps/spreadsheeteditor/main/app/view/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js @@ -624,7 +624,7 @@ define([ !this.mode.isDisconnected ) { if (tab && tab.sheetindex >= 0) { var rect = tab.$el.get(0).getBoundingClientRect(), - childPos = tab.$el.offset(), + tabPos = tab.$el.position(), parentPos = tab.$el.parent().offset(); if (!tab.isActive()) this.tabbar.setActive(tab); @@ -671,6 +671,11 @@ define([ })(); this.tabMenu.hide(); + this.tabMenu.cmpEl.dropdown('dispose').dropdown({ + boundary: $('#viewport')[0], + reference: this.tabMenu.$el, + offset: tabPos.left + ',-5' + }); this.tabMenu.show(); var menu = this.tabMenu; _.defer(function(){ diff --git a/apps/spreadsheeteditor/main/resources/less/statusbar.less b/apps/spreadsheeteditor/main/resources/less/statusbar.less index 10116eef9..501e748aa 100644 --- a/apps/spreadsheeteditor/main/resources/less/statusbar.less +++ b/apps/spreadsheeteditor/main/resources/less/statusbar.less @@ -138,7 +138,7 @@ #status-sheets-bar-box { position: absolute; - overflow: hidden; + //overflow: hidden; height: 32px; left: 112px; right: 160px; @@ -157,6 +157,10 @@ height: 100%; display: flex; + &.nav { + flex-wrap: nowrap; + } + > li { background-color: @gray-light;