Merge pull request #1992 from ONLYOFFICE/feature/fix-bugs

Feature/fix bugs
This commit is contained in:
maxkadushkin 2022-10-06 16:58:05 +03:00 committed by GitHub
commit 14ae928ce4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 54 additions and 6 deletions

View file

@ -62,15 +62,15 @@ const CustomColors = ({ options, customColors, isTypeColors, onColorClick, curCo
return (
<div className='palette'>
{colors?.length && colors.map((color, index) => {
return(
{colors && colors.length > 0 ? colors.map((color, index) => {
return (
<a key={`dc-${index}`}
className={curColor && curColor === color && index === indexCurColor && !isTypeColors ? 'active' : ''}
style={{background: `#${color}`}}
onClick={() => {onColorClick(color)}}
></a>
)
})}
}) : null}
{emptyItems.length > 0 && emptyItems}
</div>
)

View file

@ -552,6 +552,15 @@
.toggle-icon {
background: transparent;
}
// Edit Comment Popup
.edit-comment-popup {
.navbar .title {
line-height: normal;
}
}
}

View file

@ -400,7 +400,8 @@
"textAmountOfLevels": "Amount of Levels",
"textRecommended": "Recommended",
"textRequired": "Required",
"textChangeShape": "Change Shape"
"textChangeShape": "Change Shape",
"textCustomStyle": "Custom Style"
},
"Error": {
"convertationTimeoutText": "Conversion timeout exceeded.",

View file

@ -3,7 +3,6 @@ import { inject, observer } from 'mobx-react';
import { f7 } from 'framework7-react';
import { useTranslation } from 'react-i18next';
import ToolbarView from "../view/Toolbar";
import {storeAppOptions} from "../store/appOptions";
import {LocalStorage} from "../../../../common/mobile/utils/LocalStorage";
const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'storeFocusObjects', 'storeToolbarSettings','storeDocumentInfo')(observer(props => {
@ -33,12 +32,23 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
const docExt = docInfo.dataDoc ? docInfo.dataDoc.fileType : '';
const docTitle = docInfo.dataDoc ? docInfo.dataDoc.title : '';
const sensitivity = 20;
let touchStartY = 0;
let touchEndY = 0;
useEffect(() => {
const sdk = document.querySelector('#editor_sdk');
Common.Gateway.on('init', loadConfig);
Common.Notifications.on('toolbar:activatecontrols', activateControls);
Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls);
Common.Notifications.on('goback', goBack);
if(isViewer) {
sdk.addEventListener('touchstart', handleTouchStart);
sdk.addEventListener('touchend', handleTouchEnd);
}
if (isDisconnected) {
f7.popover.close();
f7.sheet.close();
@ -49,9 +59,37 @@ const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'sto
Common.Notifications.off('toolbar:activatecontrols', activateControls);
Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls);
Common.Notifications.off('goback', goBack);
if(isViewer) {
sdk.removeEventListener('touchstart', handleTouchStart);
sdk.removeEventListener('touchend', handleTouchEnd);
}
}
});
// Touch handlers
const checkDirection = () => {
const diff = touchStartY - touchEndY;
if(Math.abs(diff) > sensitivity) {
if(diff > 0) {
// f7.navbar.show('.main-navbar');
} else {
// f7.navbar.hide('.main-navbar');
}
}
};
const handleTouchStart = e => {
touchStartY = e.changedTouches[0].screenY;
};
const handleTouchEnd = e => {
touchEndY = e.changedTouches[0].screenY;
checkDirection();
};
// Back button
const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder);
const loadConfig = (data) => {

View file

@ -201,7 +201,7 @@ const EditParagraph = props => {
<Fragment>
<BlockTitle>{t('Edit.textParagraphStyle')}</BlockTitle>
<List style={{marginBottom: 0}}>
<ListItem link="/edit-paragraph-style/" title={!curStyle && curStyleName} routeProps={{
<ListItem link="/edit-paragraph-style/" title={!curStyle && t('Edit.textCustomStyle')} routeProps={{
onStyleClick: props.onStyleClick,
onSaveStyle: props.onSaveStyle,
onStyleMenuDelete: props.onStyleMenuDelete