Merge pull request #1722 from ONLYOFFICE/feature/fix-bug-react

[PE SSE] Fix Bug 56868
This commit is contained in:
Oleg Korshul 2022-04-28 08:56:32 +03:00 committed by GitHub
commit f7bc5f3e26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 10 deletions

View file

@ -442,7 +442,7 @@
&.icon-plus {
width: 22px;
height: 22px;
.encoded-svg-mask('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{toolbar-icons}"><g><path d="M21,12h-9v9h-2v-9H1v-2h9V1h2v9h9V12z"/></g></svg>', @toolbar-icons);
.encoded-svg-mask('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{fill-white}"><g><path d="M21,12h-9v9h-2v-9H1v-2h9V1h2v9h9V12z"/></g></svg>', @fill-white);
}
}

View file

@ -366,13 +366,6 @@ const Statusbar = inject('sheets', 'storeAppOptions', 'users')(observer(props =>
api.asc_showWorksheet(sheetIndex);
f7.popover.close('#idx-all-list');
}
const tab = $$('.sheet-tabs .tab').eq(sheetIndex);
if(tab.offset().left < 0) {
$$('.sheet-tabs').scrollLeft( $$('.sheet-tabs').scrollLeft() + tab.offset().left - 96, 500);
} else {
$$('.sheet-tabs').scrollLeft( $$('.sheet-tabs').scrollLeft() + (tab.offset().left + tab.width() - $$('.sheet-tabs').width()/1.5), 500);
}
};
return (

View file

@ -358,7 +358,7 @@
&.icon-plus {
width: 22px;
height: 22px;
.encoded-svg-mask('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{toolbar-icons}"><g><path d="M21,12h-9v9h-2v-9H1v-2h9V1h2v9h9V12z"/></g></svg>');
.encoded-svg-mask('<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 22 22" fill="@{fill-white}"><g><path d="M21,12h-9v9h-2v-9H1v-2h9V1h2v9h9V12z"/></g></svg>', @fill-white);
}
}

View file

@ -1,4 +1,4 @@
import React, { Fragment, useState } from 'react';
import React, { Fragment, useEffect, useState } from 'react';
import {f7, View, Link, Icon, Navbar, Popover, List, ListGroup, ListItem, ListButton, Actions, ActionsGroup, ActionsButton, Sheet, Page } from 'framework7-react';
import { useTranslation } from 'react-i18next';
import { Device } from '../../../../common/mobile/utils/device';
@ -41,6 +41,22 @@ const PageAllList = (props) => {
const { sheets, onTabListClick } = props;
const allSheets = sheets.sheets;
useEffect(() => {
const tabs = $$('.sheet-tabs .tab');
let tab = tabs.eq(sheets.activeWorksheet);
if(sheets.activeWorksheet !== -1) {
if(tab.length === 0) {
tab = tabs.eq(tabs.length - 1);
$$('.sheet-tabs').scrollLeft( tab.offset().left + tab.width(), 500);
} else if(tab.offset().left < 0) {
$$('.sheet-tabs').scrollLeft( $$('.sheet-tabs').scrollLeft() + tab.offset().left - 96, 500);
} else {
$$('.sheet-tabs').scrollLeft( $$('.sheet-tabs').scrollLeft() + (tab.offset().left + tab.width() - $$('.sheet-tabs').width()), 500);
}
}
}, [sheets.activeWorksheet]);
return (
<View style={{height: '240px'}}>
<Page>