diff --git a/apps/spreadsheeteditor/main/app/controller/Statusbar.js b/apps/spreadsheeteditor/main/app/controller/Statusbar.js index deb1b0622..88b03d382 100644 --- a/apps/spreadsheeteditor/main/app/controller/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Statusbar.js @@ -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) { diff --git a/apps/spreadsheeteditor/main/app/template/StatusBar.template b/apps/spreadsheeteditor/main/app/template/StatusBar.template index f83c71d4c..308527ffd 100644 --- a/apps/spreadsheeteditor/main/app/template/StatusBar.template +++ b/apps/spreadsheeteditor/main/app/template/StatusBar.template @@ -9,9 +9,7 @@
- +
diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js index f36e91995..3f5edce6f 100644 --- a/apps/spreadsheeteditor/main/app/view/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js @@ -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([ - '', + ' data-hidden="true" <% } %>>', '
', '<%= caption %>', '<% if (options.hidden) { %>',