Merge pull request #1992 from ONLYOFFICE/feature/fix-bugs
Feature/fix bugs
This commit is contained in:
commit
14ae928ce4
|
@ -62,7 +62,7 @@ const CustomColors = ({ options, customColors, isTypeColors, onColorClick, curCo
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='palette'>
|
<div className='palette'>
|
||||||
{colors?.length && colors.map((color, index) => {
|
{colors && colors.length > 0 ? colors.map((color, index) => {
|
||||||
return (
|
return (
|
||||||
<a key={`dc-${index}`}
|
<a key={`dc-${index}`}
|
||||||
className={curColor && curColor === color && index === indexCurColor && !isTypeColors ? 'active' : ''}
|
className={curColor && curColor === color && index === indexCurColor && !isTypeColors ? 'active' : ''}
|
||||||
|
@ -70,7 +70,7 @@ const CustomColors = ({ options, customColors, isTypeColors, onColorClick, curCo
|
||||||
onClick={() => {onColorClick(color)}}
|
onClick={() => {onColorClick(color)}}
|
||||||
></a>
|
></a>
|
||||||
)
|
)
|
||||||
})}
|
}) : null}
|
||||||
{emptyItems.length > 0 && emptyItems}
|
{emptyItems.length > 0 && emptyItems}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|
|
@ -552,6 +552,15 @@
|
||||||
.toggle-icon {
|
.toggle-icon {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Edit Comment Popup
|
||||||
|
|
||||||
|
.edit-comment-popup {
|
||||||
|
.navbar .title {
|
||||||
|
line-height: normal;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -400,7 +400,8 @@
|
||||||
"textAmountOfLevels": "Amount of Levels",
|
"textAmountOfLevels": "Amount of Levels",
|
||||||
"textRecommended": "Recommended",
|
"textRecommended": "Recommended",
|
||||||
"textRequired": "Required",
|
"textRequired": "Required",
|
||||||
"textChangeShape": "Change Shape"
|
"textChangeShape": "Change Shape",
|
||||||
|
"textCustomStyle": "Custom Style"
|
||||||
},
|
},
|
||||||
"Error": {
|
"Error": {
|
||||||
"convertationTimeoutText": "Conversion timeout exceeded.",
|
"convertationTimeoutText": "Conversion timeout exceeded.",
|
||||||
|
|
|
@ -3,7 +3,6 @@ import { inject, observer } from 'mobx-react';
|
||||||
import { f7 } from 'framework7-react';
|
import { f7 } from 'framework7-react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import ToolbarView from "../view/Toolbar";
|
import ToolbarView from "../view/Toolbar";
|
||||||
import {storeAppOptions} from "../store/appOptions";
|
|
||||||
import {LocalStorage} from "../../../../common/mobile/utils/LocalStorage";
|
import {LocalStorage} from "../../../../common/mobile/utils/LocalStorage";
|
||||||
|
|
||||||
const ToolbarController = inject('storeAppOptions', 'users', 'storeReview', 'storeFocusObjects', 'storeToolbarSettings','storeDocumentInfo')(observer(props => {
|
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 docExt = docInfo.dataDoc ? docInfo.dataDoc.fileType : '';
|
||||||
const docTitle = docInfo.dataDoc ? docInfo.dataDoc.title : '';
|
const docTitle = docInfo.dataDoc ? docInfo.dataDoc.title : '';
|
||||||
|
|
||||||
|
const sensitivity = 20;
|
||||||
|
let touchStartY = 0;
|
||||||
|
let touchEndY = 0;
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
const sdk = document.querySelector('#editor_sdk');
|
||||||
|
|
||||||
Common.Gateway.on('init', loadConfig);
|
Common.Gateway.on('init', loadConfig);
|
||||||
Common.Notifications.on('toolbar:activatecontrols', activateControls);
|
Common.Notifications.on('toolbar:activatecontrols', activateControls);
|
||||||
Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls);
|
Common.Notifications.on('toolbar:deactivateeditcontrols', deactivateEditControls);
|
||||||
Common.Notifications.on('goback', goBack);
|
Common.Notifications.on('goback', goBack);
|
||||||
|
|
||||||
|
if(isViewer) {
|
||||||
|
sdk.addEventListener('touchstart', handleTouchStart);
|
||||||
|
sdk.addEventListener('touchend', handleTouchEnd);
|
||||||
|
}
|
||||||
|
|
||||||
if (isDisconnected) {
|
if (isDisconnected) {
|
||||||
f7.popover.close();
|
f7.popover.close();
|
||||||
f7.sheet.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:activatecontrols', activateControls);
|
||||||
Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls);
|
Common.Notifications.off('toolbar:deactivateeditcontrols', deactivateEditControls);
|
||||||
Common.Notifications.off('goback', goBack);
|
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
|
// Back button
|
||||||
const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder);
|
const [isShowBack, setShowBack] = useState(appOptions.canBackToFolder);
|
||||||
const loadConfig = (data) => {
|
const loadConfig = (data) => {
|
||||||
|
|
|
@ -201,7 +201,7 @@ const EditParagraph = props => {
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<BlockTitle>{t('Edit.textParagraphStyle')}</BlockTitle>
|
<BlockTitle>{t('Edit.textParagraphStyle')}</BlockTitle>
|
||||||
<List style={{marginBottom: 0}}>
|
<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,
|
onStyleClick: props.onStyleClick,
|
||||||
onSaveStyle: props.onSaveStyle,
|
onSaveStyle: props.onSaveStyle,
|
||||||
onStyleMenuDelete: props.onStyleMenuDelete
|
onStyleMenuDelete: props.onStyleMenuDelete
|
||||||
|
|
Loading…
Reference in a new issue