[DE PE] Fix Bug 49364 v2
This commit is contained in:
parent
60350fbb13
commit
b4b013f68a
|
@ -185,8 +185,9 @@ const AddTabs = inject("storeFocusObjects", "storeTableSettings")(observer(({sto
|
|||
const onGetTableStylesPreviews = () => {
|
||||
const api = Common.EditorApi.get();
|
||||
if(storeTableSettings.isRenderStyles) {
|
||||
$$('.table-styles').hide();
|
||||
f7.preloader.showIn('.preload');
|
||||
setTimeout( () => storeTableSettings.setStyles(api.asc_getTableStylesPreviews()), 10);
|
||||
setTimeout( () => storeTableSettings.setStyles(api.asc_getTableStylesPreviews(true)), 10);
|
||||
storeTableSettings.resetFlagRender(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -12,6 +12,7 @@ const AddTable = props => {
|
|||
|
||||
const onReadyStyles = () => {
|
||||
f7.preloader.hideIn('.preload');
|
||||
$$('.table-styles').show();
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
@ -180,10 +180,10 @@ const StyleTemplates = inject("storeFocusObjects","storeTableSettings")(observer
|
|||
const styles = storeTableSettings.arrayStyles;
|
||||
|
||||
useEffect(() => {
|
||||
if (storeTableSettings.isRenderStyles) onGetTableStylesPreviews();
|
||||
return () => {
|
||||
if (storeTableSettings.isRenderStyles) {
|
||||
onGetTableStylesPreviews();
|
||||
storeTableSettings.resetFlagRender(false);
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
return (
|
||||
<div className="dataview table-styles">
|
||||
|
@ -224,12 +224,11 @@ const PageStyleOptions = props => {
|
|||
nextStateRef.current = [isFirstRow, isLastRow, isBandHor, isFirstCol, isLastCol, isBandVer];
|
||||
|
||||
useEffect(() => {
|
||||
props.storeTableSettings.resetFlagRender(false);
|
||||
prevStateRef.current = [...nextStateRef.current];
|
||||
|
||||
return () => {
|
||||
if (!(prevStateRef.current.every((item, index) => item === nextStateRef.current[index]))) {
|
||||
props.onGetTableStylesPreviews();
|
||||
props.storeTableSettings.resetFlagRender(true);
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
|
@ -238,6 +237,7 @@ const PageStyleOptions = props => {
|
|||
if ( !(prevStateRef.current.every((item, index) => item === nextStateRef.current[index]))) {
|
||||
$$('.table-styles').hide();
|
||||
f7.preloader.showIn('.preload');
|
||||
props.onGetTableStylesPreviews();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,8 +95,9 @@ class AddOtherController extends Component {
|
|||
onGetTableStylesPreviews = () => {
|
||||
const api = Common.EditorApi.get();
|
||||
if (this.props.storeTableSettings.isRenderStyles) {
|
||||
$$('.table-styles').hide();
|
||||
f7.preloader.showIn('.preload');
|
||||
setTimeout(() => this.props.storeTableSettings.setStyles(api.asc_getTableStylesPreviews()) , 10);
|
||||
setTimeout(() => this.props.storeTableSettings.setStyles(api.asc_getTableStylesPreviews(true)) , 10);
|
||||
this.props.storeTableSettings.resetFlagRender(false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ const PageTable = props => {
|
|||
|
||||
const onReadyStyles = () => {
|
||||
f7.preloader.hideIn('.preload');
|
||||
$$('.table-styles').show();
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
@ -14,10 +14,10 @@ const StyleTemplates = inject("storeFocusObjects","storeTableSettings")(observer
|
|||
const styles = storeTableSettings.arrayStyles;
|
||||
|
||||
useEffect(() => {
|
||||
if (storeTableSettings.isRenderStyles) onGetTableStylesPreviews();
|
||||
return () => {
|
||||
if (storeTableSettings.isRenderStyles) {
|
||||
onGetTableStylesPreviews();
|
||||
storeTableSettings.resetFlagRender(false);
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
|
||||
if (!tableObject && Device.phone) {
|
||||
|
@ -64,12 +64,11 @@ const PageStyleOptions = props => {
|
|||
nextStateRef.current = [isFirstRow, isLastRow, isBandHor, isFirstCol, isLastCol, isBandVer];
|
||||
|
||||
useEffect(() => {
|
||||
props.storeTableSettings.resetFlagRender(false);
|
||||
prevStateRef.current = [...nextStateRef.current];
|
||||
|
||||
return () => {
|
||||
if (!(prevStateRef.current.every((item, index) => item === nextStateRef.current[index]))) {
|
||||
props.onGetTableStylesPreviews();
|
||||
props.storeTableSettings.resetFlagRender(true);
|
||||
}
|
||||
}
|
||||
}, []);
|
||||
|
@ -78,6 +77,7 @@ const PageStyleOptions = props => {
|
|||
if ( !(prevStateRef.current.every((item, index) => item === nextStateRef.current[index]))) {
|
||||
$$('.table-styles').hide();
|
||||
f7.preloader.showIn('.preload');
|
||||
props.onGetTableStylesPreviews();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue