diff --git a/apps/spreadsheeteditor/mobile/locale/en.json b/apps/spreadsheeteditor/mobile/locale/en.json index ff3282cfb..af000bd4f 100644 --- a/apps/spreadsheeteditor/mobile/locale/en.json +++ b/apps/spreadsheeteditor/mobile/locale/en.json @@ -291,8 +291,8 @@ "textHide": "Hide", "textMore": "More", "textMove": "Move", - "textMoveBack": "Move back", - "textMoveForward": "Move forward", + "textMoveToEnd": "(Move to end)", + "textMoveBefore": "Move before sheet", "textOk": "Ok", "textRename": "Rename", "textRenameSheet": "Rename Sheet", diff --git a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx index 9db12e319..1ccff00de 100644 --- a/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx +++ b/apps/spreadsheeteditor/mobile/src/controller/Statusbar.jsx @@ -351,19 +351,14 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(observer(props => } }; - const onMenuMoveClick = (action) => { + const onMenuMoveClick = (index) => { const api = Common.EditorApi.get(); - const visibleSheets = sheets.visibleWorksheets(); - let activeIndex; - visibleSheets.forEach((item, index) => { - if(item.index === api.asc_getActiveWorksheetIndex()) { - activeIndex = visibleSheets[action === "forward" ? index+2 : index-1 ]?.index; - } - }); + let sheetsCount = api.asc_getWorksheetsCount(); + let activeIndex = api.asc_getActiveWorksheetIndex(); - api.asc_moveWorksheet(activeIndex === undefined ? api.asc_getWorksheetsCount() : activeIndex, [api.asc_getActiveWorksheetIndex()]); - } + api.asc_moveWorksheet(index === -255 ? sheetsCount : index , [activeIndex]); + }; const onTabListClick = (sheetIndex) => { const api = Common.EditorApi.get(); @@ -371,7 +366,7 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(observer(props => api.asc_showWorksheet(sheetIndex); f7.popover.close('#idx-all-list'); } - } + }; return ( { - const { t } = useTranslation(); - let { opened, setOpenActions, onMenuMoveClick, visibleSheets } = props; - - return ( - setOpenActions(false)}> - - onMenuMoveClick("back")}> - {t('Statusbar.textMoveBack')} - - onMenuMoveClick("forward")}> - {t('Statusbar.textMoveForward')} - - - - {t('Statusbar.textCancel')} - - - ) -} - const PageListMove = props => { + const { t } = useTranslation(); const { sheets, onMenuMoveClick } = props; const allSheets = sheets.sheets; - const visibleSheets = sheets.visibleWorksheets(); - const [stateActionsOpened, setOpenActions] = useState(false); return ( + - { allSheets.map(model => - model.hidden ? null : - -
setOpenActions(true) }> - -
-
) - } + + { allSheets.map((model, index) => + model.hidden ? null : + onMenuMoveClick(index)} />) + } + onMenuMoveClick(-255)}/> +
-
) }; @@ -162,7 +143,7 @@ const StatusbarView = inject('storeAppOptions', 'sheets', 'users')(observer(prop } {isPhone ? - +