Fix Bug 59819

This commit is contained in:
Julia Radzhabova 2022-11-21 23:28:43 +03:00
parent 4f4e1fb5db
commit ecfbc80925
2 changed files with 28 additions and 4 deletions

View file

@ -399,7 +399,9 @@ define([
_btns = data.buttons,
_flex = data.flex;
var more_section = $active.find('.more-box');
if (more_section.length===0) {
me.setMoreButton($active.attr('data-tab'), $active);
}
if ( !_rightedge ) {
_rightedge = $active.get(0).getBoundingClientRect().right;
}
@ -527,10 +529,30 @@ define([
this.$moreBar = btnsMore[tab].panel;
},
clearMoreButton: function(tab) {
var panel = this.$panels.filter('[data-tab=' + tab + ']');
if ( panel.length ) {
var data = panel.data();
data.buttons = data.flex = data.rightedge = undefined;
panel.find('.more-box').remove();
}
if (btnsMore[tab]) {
var moreContainer = optsFold.$bar.find('.more-container[data-tab="' + tab + '"]');
moreContainer.remove();
btnsMore[tab].remove();
delete btnsMore[tab];
}
},
resizeToolbar: function(reset) {
var $active = this.$panels.filter('.active'),
more_section = $active.find('.more-box'),
more_section_width = parseInt(more_section.css('width')) || 0,
more_section = $active.find('.more-box');
if (more_section.length===0) {
this.setMoreButton($active.attr('data-tab'), $active);
}
var more_section_width = parseInt(more_section.css('width')) || 0,
box_controls_width = $active.parents('.box-controls').width(),
_maxright = box_controls_width,
_rightedge = $active.get(0).getBoundingClientRect().right,

View file

@ -66,7 +66,7 @@ define([
if ( !appOptions.isEditMailMerge && !appOptions.isEditDiagram && !appOptions.isEditOle ) {
var tab = {action: 'plugins', caption: me.panelPlugins.groupCaption, dataHintTitle: 'E', layoutname: 'toolbar-plugins'};
me.$toolbarPanelPlugins = me.panelPlugins.getPanel();
me.toolbar = toolbar;
toolbar.addTab(tab, me.$toolbarPanelPlugins, 10); // TODO: clear plugins list in left panel
}
}
@ -248,6 +248,7 @@ define([
me.appOptions.canPlugins = !collection.isEmpty();
if ( me.$toolbarPanelPlugins ) {
me.$toolbarPanelPlugins.empty();
me.toolbar && me.toolbar.clearMoreButton('plugins');
var _group = $('<div class="group"></div>'),
rank = -1,
@ -274,6 +275,7 @@ define([
rank = new_rank;
});
_group.appendTo(me.$toolbarPanelPlugins);
me.toolbar && me.toolbar.isTabActive('plugins') && me.toolbar.processPanelVisible(null, true, true);
var docProtection = me.panelPlugins._state.docProtection;
Common.Utils.lockControls(Common.enumLock.docLockView, docProtection.isReadOnly, {array: me.panelPlugins.lockedControls});
Common.Utils.lockControls(Common.enumLock.docLockForms, docProtection.isFormsOnly, {array: me.panelPlugins.lockedControls});