From f4039727c34f1f06f4f22d265378f2d42790296e Mon Sep 17 00:00:00 2001 From: Julia Svinareva Date: Sat, 1 Feb 2020 17:17:58 +0300 Subject: [PATCH] [SSE mobile] Fix bug 42364 --- .../mobile/app/controller/Statusbar.js | 35 +++++++++++++++++-- apps/spreadsheeteditor/mobile/locale/en.json | 1 + 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/apps/spreadsheeteditor/mobile/app/controller/Statusbar.js b/apps/spreadsheeteditor/mobile/app/controller/Statusbar.js index 10b8281a7..27f7d56c4 100644 --- a/apps/spreadsheeteditor/mobile/app/controller/Statusbar.js +++ b/apps/spreadsheeteditor/mobile/app/controller/Statusbar.js @@ -62,6 +62,7 @@ define([ 'contextmenu:click': this.onTabMenu } }); + this._moreAction = []; }, events: function() { @@ -521,6 +522,25 @@ define([ }); break; case 'ren': me.renameWorksheet(); break; + case 'showMore': + if (me._moreAction.length > 0) { + _.delay(function () { + _.each(me._moreAction, function (action) { + action.text = action.caption; + action.onClick = function () { + me.onTabMenu(null, action.event, model) + } + }); + + uiApp.actions([me._moreAction, [ + { + text: me.cancelButtonText, + bold: true + } + ]]); + }, 100); + } + break; default: var _re = /reveal\:(\d+)/.exec(event); if ( _re && !!_re[1] ) { @@ -532,7 +552,7 @@ define([ _getTabMenuItems: function(model) { var wbLocked = this.api.asc_isWorkbookLocked(); - var shLocked = this.api.asc_isWorksheetLockedOrDeleted(model.get('index')); + var shLocked = this.api.asc_isWorksheetLockedOrDeleted(model.get('index')); var items = [{ caption: this.menuDuplicate, @@ -560,6 +580,16 @@ define([ }); } + if (Common.SharedSettings.get('phone') && items.length > 3) { + this._moreAction = items.slice(2); + + items = items.slice(0, 2); + items.push({ + caption: this.menuMore, + event: 'showMore' + }); + } + return items; }, @@ -578,7 +608,8 @@ define([ strRenameSheet: 'Rename Sheet', strSheetName : 'Sheet Name', cancelButtonText: 'Cancel', - notcriticalErrorTitle: 'Warning' + notcriticalErrorTitle: 'Warning', + menuMore: 'More' }, SSE.Controllers.Statusbar || {})); }); \ No newline at end of file diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index db91076d4..46e72dedd 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -308,6 +308,7 @@ "SSE.Controllers.Statusbar.strSheetName": "Sheet Name", "SSE.Controllers.Statusbar.textExternalLink": "External Link", "SSE.Controllers.Statusbar.warnDeleteSheet": "The selected worksheets might contain data. Are you sure you want to proceed?", + "SSE.Controllers.Statusbar.menuMore": "More", "SSE.Controllers.Toolbar.dlgLeaveMsgText": "You have unsaved changes in this document. Click 'Stay on this Page' to await the autosave of the document. Click 'Leave this Page' to discard all the unsaved changes.", "SSE.Controllers.Toolbar.dlgLeaveTitleText": "You leave the application", "SSE.Controllers.Toolbar.leaveButtonText": "Leave this Page",