[SSE] Bug 46767 (fix locked, fix close after click on item)

This commit is contained in:
JuliaSvinareva 2021-06-30 15:36:53 +03:00
parent f28422fb9c
commit dc5268069e
3 changed files with 15 additions and 8 deletions

View file

@ -180,6 +180,10 @@ define([
break;
}
}
var listItem =this.statusbar.sheetListMenu.items[index];
if (listItem.$el.children().first().data('hidden')) {
listItem.setDisabled(locked);
}
},
/** coauthoring end **/
@ -246,6 +250,7 @@ define([
var islocked = this.statusbar.tabbar.hasClass('coauth-locked'),
currentIdx = this.api.asc_getActiveWorksheetIndex();
this.statusbar.btnAddWorksheet.setDisabled(islocked || this.api.isCellEdited || mode!=Asc.c_oAscSelectionDialogType.None);
this.statusbar.btnSheetList[mode != Asc.c_oAscSelectionDialogType.None ? 'addClass' : 'removeClass']('disabled');
var item, i = this.statusbar.tabbar.getCount();
while (i-- > 0) {
@ -502,6 +507,10 @@ define([
this.api.asc_showWorksheet(sheetIndex);
this.loadTabColor(sheetIndex);
}
var me = this;
setTimeout(function(){
me.statusbar.sheetListMenu.hide();
}, 1);
},
selectTab: function (sheetindex) {

View file

@ -9,9 +9,7 @@
<div id="status-addtabs-box" class="status-group">
<button id="status-btn-addtab" type="button" class="btn small btn-toolbar"><i class="icon toolbar__icon btn-zoomup">&nbsp;</i></button>
<div class="cnt-tabslist">
<div class="dropdown-toggle" data-toggle="dropdown">
<button id="status-btn-tabslist" type="button" class="btn small btn-toolbar"><i class="icon toolbar__icon btn-sheet-list">&nbsp;</i></button>
</div>
<button id="status-btn-tabslist" type="button" class="btn small btn-toolbar dropdown-toggle" data-toggle="dropdown"><i class="icon toolbar__icon btn-sheet-list">&nbsp;</i></button>
</div>
</div>
<div id="status-zoom-box" class="status-group">

View file

@ -129,11 +129,12 @@ define([
hintAnchor: 'top'
});
this.btnSheetList = new Common.UI.Button({
this.cntSheetList = new Common.UI.Button({
el: $('.cnt-tabslist', this.el),
hint: this.tipListOfSheets,
hintAnchor: 'top'
});
this.btnSheetList = $('#status-btn-tabslist',this.$el);
this.sheetListMenu = new Common.UI.Menu({
style: 'margin-top:-3px;',
menuAlign: 'bl-tl',
@ -141,12 +142,11 @@ define([
});
this.sheetListMenu.on('item:click', function(obj,item) {
me.fireEvent('show:tab', [item.value]);
me.sheetListMenu.items[item.value].setChecked(true);
});
this.btnSheetList.cmpEl.on({
this.cntSheetList.cmpEl.on({
'show.bs.dropdown': function () {
_.defer(function(){
me.btnSheetList.cmpEl.find('ul').focus();
me.cntSheetList.cmpEl.find('ul').focus();
}, 100);
},
'hide.bs.dropdown': function () {
@ -573,7 +573,7 @@ define([
hidden: me.api.asc_isWorksheetHidden(item.sheetindex),
textHidden: me.itemHidden,
template: _.template([
'<a id="<%= id %>" style="<%= style %>" tabindex="-1" type="menuitem">',
'<a id="<%= id %>" style="<%= style %>" tabindex="-1" type="menuitem" <% if (options.hidden) { %> data-hidden="true" <% } %>>',
'<div class="color"></div>',
'<span class="name"><%= caption %></span>',
'<% if (options.hidden) { %>',